-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove some examples from Userdemo #25801
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
galleries/examples/subplots_axes_and_figures/demo_gridspec03.py
Outdated
Show resolved
Hide resolved
legend box. | ||
|
||
By default, Axes fill the whole figure area, and thus legends placed outside would | ||
be cut of. We therefore use a layout manager to resize everything so that the legend |
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.
be cut of. We therefore use a layout manager to resize everything so that the legend | |
be cut off. We therefore use a layout manager to resize everything so that the legend |
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.
The legend example will be handled in a separate PR. - Excluded here for now.
fig, ax = plt.subplots(layout='constrained') | ||
ax.plot([1, 2, 3], label="line 1") | ||
ax.plot([3, 2, 1], label="line 2") | ||
ax.legend(bbox_to_anchor=(1.05, 1), loc='upper left', borderaxespad=0) |
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.
Should we also mention the new outside upper left
(#19743)?
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.
The User Guide is pretty comprehensive on that. I'm not sure what the thinking is in general about duplicating information across examples/tutorials/guide.
https://matplotlib.org/devdocs/users/explain/axes/legend_guide.html#figure-legends
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.
Thanks for making me aware of the duplication. I'll check how to handle this best.
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.
The legend example will be handled in a separate PR. - Excluded here for now.
Ping? |
I will come back to this. |
a97ccbb
to
5a84688
Compare
I've reduced the PR to moving only two obvious gridspec examples. The rest will be handled in a separate PR. |
While we should consolidate the examples for creating complex Axes layouts (or rather have a guide on this), that's beyond the scope of this PR. All these examples are special enough so that we want to keep them until we have something better.
5a84688
to
afc5b0b
Compare
…801-on-v3.10.x Backport PR #25801 on branch v3.10.x (Remove some examples from Userdemo)
…801-on-v3.10.0-doc Backport PR #25801 on branch v3.10.0-doc (Remove some examples from Userdemo)
PR summary
Partly adresses #25800. See the individual commit messages.