-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: Add properties bottoms, tops, and position_centers to BarContainer #30226
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
base: main
Are you sure you want to change the base?
Conversation
239dcf3
to
44e3dcd
Compare
44e3dcd
to
df22b8a
Compare
Would |
I'm inclined to say no. |
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.
One minor suggestion, otherwise a nice addition 👍
Could also consider adding a bottoms
property to complement tops
?
df22b8a
to
4325141
Compare
|
Need to update the What's New? note (and possibly the commit message/PR title if you want.) |
4325141
to
ac87a72
Compare
These will be useful if one wants to put additional things on the bars.
Noted in #30224 (comment), which this will simplify because instad of
we can then simply do
Naming: The naming has to work for horizontal and vertical bars.
position_centers
: I use position as the non-data coordinate. This is consistent with the naming in https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.grouped_bar.html (bar()
/barh()
usex
/y
, which doesn't generalize to orientation.I intentionally chose
position_centers
overcenter_positions
, becausecenter_position
could be misinterpreted as the (x, y) coordinates of the centers of the bar rectangles.tops
: https://matplotlib.org/devdocs/api/_as_gen/matplotlib.axes.Axes.grouped_bar.html universally usesheights
and the upper end of theheight
is reasonably thetop
. I think its bearable to have this naming also in the face of potentially horizontal bars.