Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing an array as intensity for plot #1065

Merged
merged 23 commits into from
Mar 23, 2021
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pygmt/src/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
plot - Plot in two dimensions.
"""
import numpy as np
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
Expand Down Expand Up @@ -218,6 +219,14 @@ def plot(self, x=None, y=None, data=None, sizes=None, direction=None, **kwargs):
)
extra_arrays.append(sizes)

if "I" in kwargs and isinstance(kwargs["I"], np.ndarray):
core-man marked this conversation as resolved.
Show resolved Hide resolved
print(kwargs["I"])
if kind != "vectors":
raise GMTInvalidInput(
"Can't use arrays for intensity if data is matrix or file."
)
extra_arrays.append(kwargs["I"])

if "t" in kwargs and is_nonstr_iter(kwargs["t"]):
extra_arrays.append(kwargs["t"])
kwargs["t"] = ""
Expand Down