-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix for scatter not showing points with valid x/y but invalid color #10809
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
Conversation
This PR seems reasonable to me. However, the |
… updated - Fixed ambiguous kwarg to a more appropriate, less ambiguous name -> plotinvalid
@jklymak you are right, we decided to change it to plotinvalid |
The goal is reasonable; I can see the argument for using the "set_bad" color for masked or otherwise invalid points. I think the implementation will need quite a bit more thought and testing, however. As it stands, with plotinvalid=True, there is a huge change in behavior, affecting much more than the handling of colormapping: the deletion of points masked based on other variables (x, y, size, etc.) is disabled. This is related to #10381. |
… update 2 changed test_scatter_invalid_color(): where masked in ax.scatter (line 1680) => plotinvalid (line 1680)
collection.set_array(np.asarray(c)) | ||
|
||
if plotinvalid is False: | ||
collection.set_array(c) |
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 really get away w/o the np.asarray
?
Otherwise this seems to preserve the old behaviour by default and adds a useful functionality.
This will need a whats-new entry...
PR Summary
Fix for #4354 scatter points being ignored when they have a valid x,y but invalid color such as np.nan or np.inf