Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

QiCuiHub
Copy link

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

@jklymak
Copy link
Member

jklymak commented Mar 16, 2018

This PR seems reasonable to me. However, the masked kwarg is ambiguous, so I think some other name should be chosen. plotinvalid or showinvalid?

… updated

- Fixed ambiguous kwarg to a more appropriate, less ambiguous name -> plotinvalid
@QiCuiHub
Copy link
Author

@jklymak you are right, we decided to change it to plotinvalid

@efiring
Copy link
Member

efiring commented Mar 16, 2018

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)
@tacaswell tacaswell added this to the v3.0 milestone Mar 16, 2018
collection.set_array(np.asarray(c))

if plotinvalid is False:
collection.set_array(c)
Copy link
Member

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...

@tacaswell tacaswell modified the milestones: v3.0, v3.1 Jul 7, 2018
@jklymak
Copy link
Member

jklymak commented Oct 6, 2018

Ping @QiCuiHub is this still something you want to go in? We should clear up any hesitation @efiring has.

@jklymak
Copy link
Member

jklymak commented Oct 6, 2018

Closing in lieu of #12422. Thanks for getting the ball rolling @QiCuiHub !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants