8000 DOC: add quickstart section to the gridspec tutorial by phobson · Pull Request #8512 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC: add quickstart section to the gridspec tutorial #8512

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

Merged
merged 3 commits into from
Jan 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC: fix whitespace in gridspec tutorial
  • Loading branch information
phobson committed Jan 14, 2018
commit ba1b509eb094a93ee3b12be00dbe840542842b2c
15 changes: 8 additions & 7 deletions tutorials/intermediate/gridspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

How to create grid-shaped combinations of axes.

:func:`~matplotlib.pyplot.subplots`
Perhaps the primary function used to create figures and axes.
It's also similar to :func:`~matplotlib.pyplot.subplot`,
but creates and places all axes on the figure at once.

:class:`~matplotlib.gridspec.GridSpec`
Specifies the geometry of the grid that a subplot will be
placed. The number of rows and number of columns of the grid
Expand All @@ -17,11 +22,7 @@
:func:`~matplotlib.pyplot.subplot2grid`
A helper function that is similar to :func:`~matplotlib.pyplot.subplot`,
but uses 0-based indexing and let subplot to occupy multiple cells.

:func:`~matplotlib.pyplot.subplots`
perhaps the primary function used to create figures and axes.
It's also similar to :func:`~matplotlib.pyplot.subplot`,
but creates and places all axes on the figure at once.
This function is not covered in this tutorial.

"""

Expand Down Expand Up @@ -88,7 +89,7 @@
# matter.
# That means that ``width_ratios=[2, 4, 8]`` is equivalent to
# ``width_ratios=[1, 2, 4]`` within equally wide figures.
# For the sake of demonstration, we'll blindly create the axes within
# For the sake of demonstration, we'll blindly create the axes within
# ``for`` loops since we won't need them later.

fig4 = plt.figure()
Expand All @@ -107,7 +108,7 @@
############################################################################
# Learning to use ``width_ratios`` and ``height_ratios`` is particularly
# useful since the top-level function :func:`~matplotlib.pyplot.subplots`
# accepts them within the ``gridspec_kw`` parameter.
# accepts them within the ``gridspec_kw`` parameter.
# For that matter, any parameter accepted by
# :class:`~matplotlib.gridspec.GridSpec` can be passed to
# :func:`~matplotlib.pyplot.subplots` via the ``gridspec_kw`` parameter.
Expand Down
0