Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 81440be

Browse files
jklymaktimhoffmQuLogic
committed
DOC: modernize gridspec tutorial
Co-authored-by: Tim Hoffmann <[email protected]> Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent 73304d2 commit 81440be

File tree

9 files changed

+395
-273
lines changed

9 files changed

+395
-273
lines changed

.flake8

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ per-file-ignores =
9494
tutorials/colors/colormap-manipulation.py: E402
9595
tutorials/intermediate/artists.py: E402
9696
tutorials/intermediate/constrainedlayout_guide.py: E402
97-
tutorials/intermediate/gridspec.py: E402
9897
tutorials/intermediate/legend_guide.py: E402
9998
tutorials/intermediate/tight_layout_guide.py: E402
10099
tutorials/introductory/customizing.py: E501

doc/users/prev_whats_new/whats_new_1.0.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ Sophisticated subplot grid layout
2323

2424
Jae-Joon Lee has written :mod:`~matplotlib.gridspec`, a new module for
2525
doing complex subplot layouts, featuring row and column spans and
26-
more. See :doc:`/tutorials/intermediate/gridspec` for a tutorial overview.
26+
more. See :doc:`/tutorials/intermediate/arranging_axes` for a tutorial
27+
overview.
2728

2829
.. figure:: ../../gallery/userdemo/images/sphx_glr_demo_gridspec01_001.png
2930
:target: ../../gallery/userdemo/demo_gridspec01.html

examples/lines_bars_and_markers/scatter_hist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def scatter_hist(x, y, ax, ax_histx, ax_histy):
6060
# --------------------------------------------
6161
#
6262
# We define a gridspec with unequal width- and height-ratios to achieve desired
63-
# layout. Also see the :doc:`/tutorials/intermediate/gridspec` tutorial.
63+
# layout. Also see the :doc:`/tutorials/intermediate/arranging_axes` tutorial.
6464

6565
# Start with a square Figure.
6666
fig = plt.figure(figsize=(6, 6))

examples/subplots_axes_and_figures/gridspec_and_subplots.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
and then remove the covered axes and fill the gap with a new bigger axes.
99
Here we create a layout with the bottom two axes in the last column combined.
1010
11-
See also :doc:`/tutorials/intermediate/gridspec`.
11+
To start with this layout (rather than removing the overlapping axes) use
12+
`~.pyplot.subplot_mosaic`.
13+
14+
See also :doc:`/tutorials/intermediate/arranging_axes`.
1215
"""
1316

1417
import matplotlib.pyplot as plt

lib/matplotlib/gridspec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
The `GridSpec` specifies the overall grid structure. Individual cells within
66
the grid are referenced by `SubplotSpec`\s.
77
8-
See the tutorial :doc:`/tutorials/intermediate/gridspec` for a comprehensive
9-
usage guide.
8+
Often, users need not access this module directly, and can use higher-level
9+
methods like `~.pyplot.subplots`, `~.pyplot.subplot_mosaic` and
10+
`~.Figure.subfigures`. See the tutorial
11+
:doc:`/tutorials/intermediate/arranging_axes` for a guide.
1012
"""
1113

1214
import copy

0 commit comments

Comments
 (0)