-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FIX: allow single-string color for scatter #12431
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
FIX: allow single-string color for scatter #12431
Conversation
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.
Subject to CI passing.
Travis error is MacOS image tolerance of 0.005 changing for |
I wonder if this is the correct fix. The documentation also states
So for
one would expect two points with different shades of grey. But this is converted to an array of values and shown with the viridis colormap. |
Well, that didn't work for v2.2.3 either. I don't see any reason that the above shouldn't work the way you say, but its not a regression like #12429 is. |
The newest two commits allow lists like |
setup.py
Outdated
@@ -15,13 +15,12 @@ | |||
error = """ | |||
Matplotlib 3.0+ does not support Python 2.x, 3.0, 3.1, 3.2, 3.3, or 3.4. | |||
Beginning with Matplotlib 3.0, Python 3.5 and above is required. | |||
|
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.
You seem to have some extra changes in this file.
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.
Yeah, sorry - will clean up
976ae9f
to
7e58b82
Compare
Added more to the PR (list of numeric strings)
@@ -1763,6 +1765,9 @@ def test_scatter_color(self): | |||
([0.5]*3, None), # should emit a warning for user's eyes though | |||
([0.5]*4, None), # NB: no warning as matching size allows mapping | |||
([0.5]*5, "shape"), | |||
# list of strings: | |||
(['0.5', '0.4', '0.6', '0.7'], None), | |||
(['0.5', 'red', '0.6', 'C5'], None), |
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.
Can you please add mixtures of string and float to the test? I.e. c=[0.5, '0.5']
and c=['0.5', 0.5]
.
Not sure what this should result in, but it should either be a defined output or raise an appropriate error. Either way it should be tested.
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.
Good idea. Done!
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.
Note that it errors, which I think is correct.
7e58b82
to
3cd9b69
Compare
ping @QuLogic to clear block (setup.py was inadvertently modified) |
…431-on-v3.0.x Backport PR #12431 on branch v3.0.x (FIX: allow single-string color for scatter)
PR Summary
Closes #12429
Closes #12438
New test fails master, passes this PR, and looks correct:
PR Checklist