Skip to content

FIX: Handle masked arrays for RGBA input with ScalarMappables #26096

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

Merged
merged 1 commit into from
Jun 10, 2023

Conversation

greglucas
Copy link
Contributor

PR summary

Currently, the mask is ignored if a user passes in RGB(A) input arrays. This sets the alpha channel to 0 when any RGB(A) input is masked. This is relevant for RGB(A) data being used with pcolormesh. xref: SciTools/cartopy#2166 where it will simplify downstream accounting for masks and alpha.

PR checklist

@greglucas greglucas added this to the v3.8.0 milestone Jun 9, 2023
@greglucas greglucas requested a review from rcomer June 9, 2023 01:48
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs an API change note.

I'm sure we have at least one user who is relying on the mask being ignored!

I do not think this needs a deprecation cycle (as I suspect "just document it" was to avoid fixing a bug).

This sets the alpha channel to 0 when any RGB(A) input is masked.
@greglucas
Copy link
Contributor Author

👍 Added a change note now.

Copy link
Member

@rcomer rcomer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this @greglucas!

I have also verified that it enables the hoped for simplification of my Cartopy branch.

@rcomer rcomer merged commit 5258ffc into matplotlib:main Jun 10, 2023
@greglucas greglucas deleted the sm-masked-rgba branch June 10, 2023 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants