-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add an "extend" keyword to colors.BoundaryNorm #4850
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
Milestone
Comments
It should be a separate PR. I see the logic of what you want, but we need to be careful about how this relates to other uses of "extend" (colorbar and contourf) and to other norms. |
Sounds reasonable: I'll wait for the current PR to be closed first. |
The new related PR: #5034 |
Looks like this was done at #17534. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've always found the third colorbar example from the gallery quite inelegant (http://matplotlib.org/examples/api/colorbar_only.html). Very often, you would like to extend your colorbar while using the same color scheme as the current colormap, not by adding new colors with
set_over
andset_under
.Maybe I am missing something, but the current behaviour without
set_over
leads to the same color for the last box of the colorbar and the extension. I found it quite easy to add a newextend
keyword to the existing BoundaryNorm class that does the exact same thing as before but handles the color choice differently. It is best shown with the example below:Which produces:

What do you think? If accepted I could easily add it to my ongoing PR
The text was updated successfully, but these errors were encountered: