Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e1b6ce1

Browse filesBrowse files
committed
Reword subplot() doc.
1 parent 621393b commit e1b6ce1
Copy full SHA for e1b6ce1

File tree

Expand file treeCollapse file tree

1 file changed

+11
-17
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-17
lines changed

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+11-17Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -974,28 +974,22 @@ def gca(**kwargs):
974974

975975
def subplot(*args, **kwargs):
976976
"""
977-
Return a subplot axes positioned by the given grid definition.
977+
Return a subplot axes at the given grid position.
978978
979-
Typical call signature::
979+
Call signature::
980980
981-
subplot(nrows, ncols, plot_number)
981+
subplot(nrows, ncols, index, **kwargs)
982982
983-
Where *nrows* and *ncols* are used to notionally split the figure
984-
into ``nrows * ncols`` sub-axes, and *plot_number* is used to identify
985-
the particular subplot that this function is to create within the notional
986-
grid. *plot_number* starts at 1, increments across rows first and has a
987-
maximum of ``nrows * ncols``.
983+
In the current figure, create and return an `~.Axes`, at position *index*
984+
of a (virtual) grid of *nrows* by *ncols* axes. Indexes go from 1 to
985+
``nrows * ncols``, incrementing in row-major order.
988986
989-
In the case when *nrows*, *ncols* and *plot_number* are all less than 10,
990-
a convenience exists, such that the a 3 digit number can be given instead,
991-
where the hundreds represent *nrows*, the tens represent *ncols* and the
992-
units represent *plot_number*. For instance::
987+
If *nrows*, *ncols* and *index* are all less than 10, they can also be
988+
given as a single, concatenated, three-digit number.
993989
994-
subplot(211)
995-
996-
produces a subaxes in a figure which represents the top plot (i.e. the
997-
first) in a 2 row by 1 column notional grid (no grid actually exists,
998-
but conceptually this is how the returned subplot has been positioned).
990+
For example, ``subplot(2, 3, 3)`` and ``subplot(233)`` both create an
991+
`~.Axes` at the top right corner of the current figure, occupying half of
992+
the figure height and a third of the figure width.
999993
1000994
.. note::
1001995

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.