-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
BUG: keep the ticks when the colorbar axis is inverted #13530
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
@@ -238,6 +238,8 @@ def __init__(self, colorbar): | |||
super().__init__(nbins=nbins, steps=steps) | |||
|
|||
def tick_values(self, vmin, vmax): | |||
if vmin > vmax: | |||
vmin, vmax = vmax, vmin |
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.
This seems good. MaxNLocator
uses mtransforms.nonsingular
to do the same thing. Not sure its needed here...
I haven't checked whether the other |
All I did was copy what was in the parent locators I think. |
cbar = fig.colorbar(pc, ax=ax) | ||
ticks = cbar.get_ticks() | ||
cbar.ax.invert_yaxis() | ||
assert cbar.get_ticks() == ticks |
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.
need to use assert_array_equal or something like that
a) I think they all need this treatment - sorry for not catching that |
Marking RC - this is a bug that should be fixed ASAP. @efiring, if you want me to do it, because I made the mess, I'm happy to fix it for all the different norms... |
@jklymak I agree, this is high priority for getting fixed and released ASAP, and I would be happy to have you take it over. |
PR Summary
PR Checklist