Add a helper to copy a colormap and set its extreme colors.#14645
Add a helper to copy a colormap and set its extreme colors.#14645timhoffm merged 1 commit intomatplotlib:masterfrom
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.
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