-
Notifications
You must be signed in to change notification settings - Fork 219
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 non-string color when input data is a matrix or a file for plot and plot3d #1526
Conversation
@@ -302,12 +302,13 @@ def test_plot_sizes_colors_transparencies(): | |||
return fig | |||
|
|||
|
|||
@pytest.mark.mpl_image_compare | |||
@pytest.mark.mpl_image_compare(filename="test_plot_matrix.png") | |||
@pytest.mark.parametrize("color", ["#aaaaaa", 170]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we set G="sequence"
so that people can input RGB or CMYK colors as a list like [170, 170, 170]
or [0, 0, 0, 33]
which gets converted to 170/170/170
and 0/0/0/33
respectively? Ref https://docs.generic-mapping-tools.org/6.2/gmtcolors.html#description.
Edit: Oh wait, this will be messy since color can be a 1d array... Maybe not.
… and plot3d (GenericMappingTools#1526) * Allow non-string color when input data is a matrix or a file for plot and plot3d * Expand existing tests to test int type colors
Description of proposed changes
The following script raises an error with PyGMT v0.4.1 and the master branch:
because the following code is too strict about the
color
type.pygmt/pygmt/src/plot.py
Lines 242 to 248 in f7d5526
This PR fixed the check to make sure that types like string, float, boolean or None can be used.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version