Speed up mesh-based autoalign plotting of Maps#8161
Merged
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Member
Author
|
After lots of testing, I have decided that matplotlib is making the correct decision to not allow NaN input to |
3d86203 to
1c0824a
Compare
d3c12b1 to
d9ca0ea
Compare
Cadair
reviewed
May 6, 2025
Member
Cadair
left a comment
There was a problem hiding this comment.
Generally looks great. Just a small 🦬 to 🪒 as always.
Cadair
approved these changes
May 7, 2025
This was referenced May 7, 2025
nabobalis
reviewed
May 12, 2025
nabobalis
approved these changes
May 12, 2025
This was referenced May 12, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For autoalign plotting of Maps (using
pcolormesh()internally), it's nice that we can pass matplotlib the pixel->pixel transformation via thetransformkeyword, but that means that matplotlib performs the transformation with every rendering update (e.g., panning). Instead, we can refactor the approach so that the pixel->pixel transformation is performed only once, and then panning performance greatly improves.pcolormesh()still needs time to render all the data pixels, butautoalign=Trueis far less miserable now for interactive plots.As a bonus, because we compute the transformation ourselves instead of having matplotlib do it, we can now properly update the plot limits. Previously, matplotlib's automatic detection would get thrown off by any NaNs in the coordinates.