@@ -1156,15 +1156,6 @@ def subplot(*args, **kwargs):
1156
1156
If you do not want this behavior, use the `.Figure.add_subplot` method
1157
1157
or the `.pyplot.axes` function instead.
1158
1158
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
1159
In rare circumstances, `.Figure.add_subplot` may be called with a single
1169
1160
argument, a subplot axes instance already created in the
1170
1161
present figure but not in the figure's list of axes.
@@ -1221,17 +1212,7 @@ def subplot(*args, **kwargs):
1221
1212
"and/or 'nrows'. Did you intend to call subplots()?" )
1222
1213
1223
1214
fig = gcf ()
1224
-
1225
- # First, search for an existing subplot with a matching spec.
1226
- key = SubplotSpec ._from_subplot_args (fig , args )
1227
- ax = next (
1228
- (ax for ax in fig .axes
1229
- if hasattr (ax , 'get_subplotspec' ) and ax .get_subplotspec () == key ),
1230
- None )
1231
-
1232
- # If no existing axes match, then create a new one.
1233
- if ax is None :
1234
- ax = fig .add_subplot (* args , ** kwargs )
1215
+ ax = fig .add_subplot (* args , ** kwargs )
1235
1216
1236
1217
bbox = ax .bbox
1237
1218
axes_to_delete = []
0 commit comments