You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The color parameter of plot and plot3d methods can be 1d array #1075
We need to update the documentation for the color parameter in plot and plot3d because color can also be 1d array (originally posted in #1065 (comment)).
See the description of the color parameter of plot:
color (str) – Select color or pattern for filling of symbols or polygons. Default is no fill.
See the description of the color parameter of plot3d:
color (str) – Select color or pattern for filling of symbols or polygons. Default is no fill.
However, color can also be a 1d array just like the sizes parameter when we use x/y parameters for in the plot and plot3d methods. See the last example in Plotting data points. We can set color=data.depth_km and data.depth_km is a 1d array.
Activity
seisman commentedon Mar 18, 2021
If I understand it correctly, we only need to update the docstrings to mention that
colorcan be a string or a 1darray?core-man commentedon Mar 18, 2021
I think so. May better to add an additional note (
Only valid if using x/y) like thesizeparameter for theplotmethod.Because we raise
GMTInvalidInputwhencoloris used with thedataparameter just like thesizesparameter.pygmt/pygmt/src/plot.py
Lines 207 to 211 in 1a2289a
pygmt/pygmt/src/plot.py
Lines 214 to 218 in 1a2289a
seisman commentedon Mar 18, 2021
Sounds good. Maybe also need to mention that
cmapis required ifcoloris a 1darray (I don't check if it's true).core-man commentedon Mar 18, 2021
I think so. See GMT plot:
@seisman
I use the above Plot data points code but remove
cmap=True. Cannot plot the symbols. So you are right.seisman commentedon May 4, 2021
@core-man This issue looks easy to fix. Do you want to work on it?
core-man commentedon May 4, 2021
So we don't want to leave it to new contributors?
seisman commentedon May 4, 2021
The description of the issue is so long that people may be lost about what they should do.
You may either submit a quick fix or give more details about the expected changes.