55Customizing Location of Subplot Using GridSpec
66**********************************************
77
8- `` GridSpec ` `
8+ :class: ` ~matplotlib.gridspec. GridSpec `
99 specifies the geometry of the grid that a subplot will be
1010 placed. The number of rows and number of columns of the grid
1111 need to be set. Optionally, the subplot layout parameters
1212 (e.g., left, right, etc.) can be tuned.
1313
14- `` SubplotSpec ` `
14+ :class: ` ~matplotlib.gridspec. SubplotSpec `
1515 specifies the location of the subplot in the given *GridSpec *.
1616
17- `` subplot2grid ` `
18- a helper function that is similar to " pyplot.subplot" but uses
19- 0-based indexing and let subplot to occupy multiple cells.
17+ :func: ` ~matplotlib.pyplot. subplot2grid `
18+ a helper function that is similar to :func: ` ~matplotlib. pyplot.subplot`
19+ but uses 0-based indexing and let subplot to occupy multiple cells.
2020
2121
2222Basic Example of using subplot2grid
2323===================================
2424
25- To use subplot2grid, you provide geometry of the grid and the location
26- of the subplot in the grid. For a simple single-cell subplot::
25+ To use :func: `~matplotlib.pyplot.subplot2grid `, you provide geometry of
26+ the grid and the location of the subplot in the grid. For a simple
27+ single-cell subplot::
2728
2829 ax = plt.subplot2grid((2, 2), (0, 0))
2930
3031is identical to ::
3132
3233 ax = plt.subplot(2, 2, 1)
3334
34- Note that, unlike matplotlib 's subplot, the index starts from 0 in GridSpec.
35+ Note that, unlike Matplotlib 's subplot, the index starts from 0 in GridSpec.
3536
3637To create a subplot that spans multiple cells, ::
3738
@@ -54,11 +55,12 @@ creates
5455GridSpec and SubplotSpec
5556========================
5657
57- You can create GridSpec explicitly and use them to create a Subplot.
58+ You can create :class: `~matplotlib.gridspec.GridSpec ` explicitly and use
59+ them to create a subplot.
5860
5961For example, ::
6062
61- ax = plt.subplot2grid((2, 2),(0, 0))
63+ ax = plt.subplot2grid((2, 2), (0, 0))
6264
6365is equal to ::
6466
@@ -67,7 +69,7 @@ is equal to ::
6769 ax = plt.subplot(gs[0, 0])
6870
6971A GridSpec instance provides array-like (2d or 1d) indexing that
70- returns the SubplotSpec instance. For, SubplotSpec that spans multiple
72+ returns the SubplotSpec instance. For a SubplotSpec that spans multiple
7173cells, use slice. ::
7274
7375 ax2 = plt.subplot(gs[1, :-1])
@@ -93,8 +95,8 @@ parameters of subplots that are created from the GridSpec. ::
9395 gs1 = gridspec.GridSpec(3, 3)
9496 gs1.update(left=0.05, right=0.48, wspace=0.05)
9597
96- This is similar to * subplots_adjust * , but it only affects the subplots
97- that are created from the given GridSpec.
98+ This is similar to :func: ` ~matplotlib.pyplot. subplots_adjust` , but it only
99+ affects the subplots that are created from the given GridSpec.
98100
99101The code below ::
100102
@@ -117,8 +119,9 @@ creates
117119GridSpec using SubplotSpec
118120==========================
119121
120- You can create GridSpec from the SubplotSpec, in which case its layout
121- parameters are set to that of the location of the given SubplotSpec. ::
122+ You can create GridSpec from the :class: `~matplotlib.gridspec.SubplotSpec `,
123+ in which case its layout parameters are set to that of the location of
124+ the given SubplotSpec. ::
122125
123126 gs0 = gridspec.GridSpec(1, 2)
124127
0 commit comments