-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: add long_axis property to colorbar #27167
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
lib/matplotlib/colorbar.py
Outdated
@@ -433,6 +433,11 @@ def __init__(self, ax, mappable=None, *, cmap=None, | |||
self._extend_cid2 = self.ax.callbacks.connect( | |||
"ylim_changed", self._do_extends) | |||
|
|||
@property | |||
def long_axis(self): | |||
"""Axis that has decorations (ticks etc) on it.""" |
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.
comma before etc.
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.
Looks fine to me; we could consider replacing all internal uses of _long_axis() by the public long_axis but there's no urgency to do that.
I think I replaced all the _long_axis calls. |
Can we please still have a short discussion on naming? See #26896 (comment) |
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.
Blocking to prevent accidental merge until this is discussed per @timhoffm's comments
I don't love value or color cause those are the fill values of the colorbar (texture could be added instead of color) and not exactly the axis of the bar frame.
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.
Forgot to actually select request changes 🤦♀️
Let's move this forward. I still favor
But if not, let's not hold this up longer. |
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'd favor to switch to data_axis
. But if you don't follow that argument long_axis
is still ok.
@jklymak please decide yourself and merge afterwards.
@jklymak should we drop this still into 3.10? |
TST: check long axis correct
de0ce33
to
fecdb54
Compare
I'm going to go ahead and merge. Thanks for the ping. I still prefer "long axis" ;-) |
PR summary
As discussed in #26896 exposing a long_axis property for colorbar.
PR checklist