-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add a helper to copy a colormap and set its extreme colors. #14645
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
I like this addition and would find it very useful. I wonder if |
Alternatively one could argue that
|
Initially I thought that changing
Thus, I think modifying On the other hand, I would say that |
As you've pointed out Since Side remark: I'm also not sure if the segmentation |
e1eded8
to
e9420e1
Compare
See changelog. See also the number of explicit copies in the examples, which suggest that the old setter-based API is a bit of a footgun (as forgetting to copy seems easy).
e9420e1
to
05b9573
Compare
I really like this pattern. |
This does seem useful. Wasn't sure how it fit in w/ @timhoffm plans for the colormap registry... |
This does not interfere with my plans for the colormap registry (#18503). The registry only conerns registered colormaps. You can still have separate colormap objects and create new ones. In fact,
|
@@ -0,0 +1,13 @@ | |||
`.Colormap.set_extremes` and `.Colormap.with_extremes` |
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.
I think we've decided not to put links in section titles for aestethic reasons.
But I'm going to merge as is. I'll anyway do a small colormap-related cleanup PR and will update there. While that's a bit of a messy way of working it saves us an extra review roundtrip here.
See changelog. See also the number of explicit copies in the examples,
which suggest that the old setter-based API is a bit of a footgun (as
forgetting to copy seems easy).
PR Summary
PR Checklist