Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
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
to99c31da
CompareThere 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.
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
to7fc37be
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
d6cfc3f
to789f3a5
Compared64a582
to792c28a
Compare@@ -109,12 +102,24 @@ def scatter_hist(x, y, ax, ax_histx, ax_histy): | |||
# %% | |||
# | |||
# 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)
# .. admonition:: References | ||
# | ||
# The use of the following functions, methods, classes and modules is shown | ||
# in this example: | ||
# | ||
# - `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)
Thanks for the help@timhoffm |
Follow up to#29667 to use subplot_mosaic instead of
add_gridspec
and threeadd_subplot
calls.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.