-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add example for a stacked horizontal bar chart #14262
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
Add example for a stacked horizontal bar chart #14262
Conversation
6a9647f
to
7cdfdf0
Compare
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.
Nice example.
|
||
import matplotlib | ||
matplotlib.axes.Axes.barh | ||
matplotlib.pyplot.barh |
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.
Why are the pyplot versions included in this list, when they aren't used in the example?
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 reference section
- provides a link to the function doc page
- ensures that the function doc page contains a link to the respective example
For the first point, one could argue that no such link is needed. The second point however makes this useful; people often arrive at the pyplot function docs (e.g. by googling "matplotlib barh") - in this case they might want to see the same example linked, even if it does not necessarily use plt.barh
, but ax.barh
instead.
I like the example (and its very clean), so approving. I do wonder though if it wasn't better be put in the same section as other |
Fair point I’ll move the example to the other section. |
7cdfdf0
to
d65fbfd
Compare
…rizontal bar chart
d65fbfd
to
b3b3e21
Compare
Moved to section "lines, bars and markers". This is ready to go. |
…262-on-v3.1.x Backport PR #14262 on branch v3.1.x (Add example for a stacked horizontal bar chart)
…262-on-v3.1.0-doc Backport PR #14262 on branch v3.1.0-doc (Add example for a stacked horizontal bar chart)
PR Summary
There's only one example for a simple (vertical) stacked bar chart. I think this is a worthwhile addition:
Example: