@@ -1072,10 +1072,10 @@ def cla():
10721072@docstring .dedent_interpd
10731073def subplot (* args , ** kwargs ):
10741074 """
1075- Add a subplot to the current figure.
1075+ Add an Axes to the current figure or retrieve an existing Axes .
10761076
1077- Wrapper of `.Figure.add_subplot` with a difference in
1078- behavior explained in the notes section.
1077+ This is a wrapper of `.Figure.add_subplot` which provides additional
1078+ behavior when working with the implicit API (see the notes section) .
10791079
10801080 Call signatures::
10811081
@@ -1142,8 +1142,8 @@ def subplot(*args, **kwargs):
11421142
11431143 Notes
11441144 -----
1145- Creating a subplot will delete any pre-existing subplot that overlaps
1146- with it beyond sharing a boundary::
1145+ Creating a new Axes will delete any pre-existing Axes that
1146+ overlaps with it beyond sharing a boundary::
11471147
11481148 import matplotlib.pyplot as plt
11491149 # plot a line, implicitly creating a subplot(111)
@@ -1156,18 +1156,10 @@ def subplot(*args, **kwargs):
11561156 If you do not want this behavior, use the `.Figure.add_subplot` method
11571157 or the `.pyplot.axes` function instead.
11581158
1159- If the figure already has a subplot with key (*args*,
1160- *kwargs*) then it will simply make that subplot current and
1161- return it. This behavior is deprecated. Meanwhile, if you do
1162- not want this behavior (i.e., you want to force the creation of a
1163- new subplot), you must use a unique set of args and kwargs. The axes
1164- *label* attribute has been exposed for this purpose: if you want
1165- two subplots that are otherwise identical to be added to the figure,
1166- make sure you give them unique labels.
1167-
1168- In rare circumstances, `.Figure.add_subplot` may be called with a single
1169- argument, a subplot axes instance already created in the
1170- present figure but not in the figure's list of axes.
1159+ If the current Figure already has an Axes created with the same
1160+ (*args*, *kwargs*) the existing Axes will be made current and
1161+ returned. If the values in *kwargs* are mutable this may not
1162+ behave as expected.
11711163
11721164 See Also
11731165 --------
@@ -1183,10 +1175,10 @@ def subplot(*args, **kwargs):
11831175 plt.subplot(221)
11841176
11851177 # equivalent but more general
1186- ax1= plt.subplot(2, 2, 1)
1178+ ax1 = plt.subplot(2, 2, 1)
11871179
11881180 # add a subplot with no frame
1189- ax2= plt.subplot(222, frameon=False)
1181+ ax2 = plt.subplot(222, frameon=False)
11901182
11911183 # add a polar subplot
11921184 plt.subplot(223, projection='polar')
@@ -1199,6 +1191,10 @@ def subplot(*args, **kwargs):
11991191
12001192 # add ax2 to the figure again
12011193 plt.subplot(ax2)
1194+
1195+ # make the first axes "current" again
1196+ plt.subplot(221)
1197+
12021198 """
12031199
12041200 # if subplot called without arguments, create subplot(1, 1, 1)
0 commit comments