File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Filter options
Expand file tree Collapse file tree 3 files changed +18
-6
lines changed
Original file line number Diff line number Diff line change
1
+ API changes
2
+ ```````````
3
+
4
+ `.Figure.add_subplot() ` and `.pyplot.subplot() ` do not accept a `figure `
5
+ keyword argument anymore. It only used to work anyway if the passed figure
6
+ was ``self `` or the current figure, respectively.
Original file line number Diff line number Diff line change @@ -1301,9 +1301,9 @@ def add_subplot(self, *args, **kwargs):
1301
1301
Other Parameters
1302
1302
----------------
1303
1303
**kwargs
1304
- This method also takes the keyword arguments for
1305
- the returned axes base class . The keyword arguments for the
1306
- rectilinear base class `~.axes.Axes` can be found in
1304
+ This method also takes the keyword arguments for the returned axes
1305
+ base class; except for the *figure* argument . The keyword arguments
1306
+ for the rectilinear base class `~.axes.Axes` can be found in
1307
1307
the following table but there might also be other keyword
1308
1308
arguments if another projection is used.
1309
1309
%(Axes)s
@@ -1376,6 +1376,12 @@ def add_subplot(self, *args, **kwargs):
1376
1376
"three-digit number, not {}" .format (args [0 ]))
1377
1377
args = tuple (map (int , str (args [0 ])))
1378
1378
1379
+ if 'figure' in kwargs :
1380
+ # Axes itself allows for a 'figure' kwarg, but since we want to
1381
+ # bind the created Axes to self, it is not allowed here.
1382
+ raise TypeError (
1383
+ "add_subplot() got an unexpected keyword argument 'figure'" )
1384
+
1379
1385
if isinstance (args [0 ], SubplotBase ):
1380
1386
1381
1387
a = args [0 ]
Original file line number Diff line number Diff line change @@ -912,9 +912,9 @@ def subplot(*args, **kwargs):
912
912
Other Parameters
913
913
----------------
914
914
**kwargs
915
- This method also takes the keyword arguments for
916
- the returned axes base class . The keyword arguments for the
917
- rectilinear base class `~.axes.Axes` can be found in
915
+ This method also takes the keyword arguments for the returned axes
916
+ base class; except for the *figure* argument . The keyword arguments
917
+ for the rectilinear base class `~.axes.Axes` can be found in
918
918
the following table but there might also be other keyword
919
919
arguments if another projection is used.
920
920
%(Axes)s
You can’t perform that action at this time.
0 commit comments