Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
DOC: change marginal scatter plot to subplot_mosaic#29670
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
2c2741d to99c31daCompare
timhoffm left a 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.
Additional note: The examples seems to be more about subplots and placements rather than lines bars and markers. I propose to move this to the "Subplots, Axes and figures" section. Here or in a followup PR.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
jklymak commentedFeb 24, 2025
For sure could do that - I think the original motivation was to show folks how to make this relatively common plot type, so having it here lets them see that its possible, though of course the only "hard" thing about it is the axes layout. I could see the case for going in either direction. |
99c31da to7fc37beCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
d6cfc3f to789f3a5Compared64a582 to792c28aCompare| # | ||
| # While we recommend using one of the two methods described above, there are | ||
| # number of other ways to achieve a similar layout: | ||
| # - The Axes can be positioned manually in relative coordinates using |
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 Axes can be positioned manually in relative coordinates using | |
| # | |
| # - The Axes can be positioned manually in relative coordinates using |
Sorry, overlooked one additional ReST formatting issue (bullet lists must be separated with an empty line)
| # | ||
| # - `matplotlib.figure.Figure.add_subplot` | ||
| # - `matplotlib.figure.Figure.subplot_mosaic` | ||
| # - `matplotlib.figure.Figure.add_gridspec` |
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.
| # - `matplotlib.figure.Figure.add_gridspec` |
No longer 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.
replaced withadd_subplot also addedpyplot.subplot_mosaic because that is more relevant.
# - `matplotlib.figure.Figure.subplot_mosaic`# - `matplotlib.pyplot.subplot_mosaic`# - `matplotlib.figure.Figure.add_subplot`# - `matplotlib.axes.Axes.inset_axes`# - `matplotlib.axes.Axes.scatter`# - `matplotlib.axes.Axes.hist`| While `.Axes.inset_axes` may be a bit more complex, it allows correct handling | ||
| of main Axes with a fixed aspect ratio. |
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.
| While`.Axes.inset_axes`maybeabitmorecomplex,itallowscorrecthandling | |
| ofmainAxeswithafixedaspectratio. |
Optional, but could be left out. That is also explained at the start of the inset_axes example itself.
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 guess I think it is also useful to explain why there are two methods where they are listed. A bit of repetition is probably OK.
0b7a88a intomatplotlib:mainUh oh!
There was an error while loading.Please reload this page.
…670-on-v3.10.xBackport PR#29670 on branch v3.10.x (DOC: change marginal scatter plot to subplot_mosaic)
…670-on-v3.10.0-docBackport PR#29670 on branch v3.10.0-doc (DOC: change marginal scatter plot to subplot_mosaic)
jklymak commentedFeb 27, 2025
Thanks for the help@timhoffm |
Follow up to#29667 to use subplot_mosaic instead of
add_gridspecand threeadd_subplotcalls.I actually removed the gridspec example, though happy to revert and put at the end. I don't think users in general should ever need to use gridspec.