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 @@ -1307,9 +1307,9 @@ def add_subplot(self, *args, **kwargs):
1307
1307
Other Parameters
1308
1308
----------------
1309
1309
**kwargs
1310
- This method also takes the keyword arguments for
1311
- the returned axes base class . The keyword arguments for the
1312
- rectilinear base class `~.axes.Axes` can be found in
1310
+ This method also takes the keyword arguments for the returned axes
1311
+ base class; except for the *figure* argument . The keyword arguments
1312
+ for the rectilinear base class `~.axes.Axes` can be found in
1313
1313
the following table but there might also be other keyword
1314
1314
arguments if another projection is used.
1315
1315
@@ -1378,6 +1378,12 @@ def add_subplot(self, *args, **kwargs):
1378
1378
"three-digit number, not {}" .format (args [0 ]))
1379
1379
args = tuple (map (int , str (args [0 ])))
1380
1380
1381
+ if 'figure' in kwargs :
1382
+ # Axes itself allows for a 'figure' kwarg, but since we want to
1383
+ # bind the created Axes to self, it is not allowed here.
1384
+ raise TypeError (
1385
+ "add_subplot() got an unexpected keyword argument 'figure'" )
1386
+
1381
1387
if isinstance (args [0 ], SubplotBase ):
1382
1388
1383
1389
a = args [0 ]
Original file line number Diff line number Diff line change @@ -929,9 +929,9 @@ def subplot(*args, **kwargs):
929
929
Other Parameters
930
930
----------------
931
931
**kwargs
932
- This method also takes the keyword arguments for
933
- the returned axes base class . The keyword arguments for the
934
- rectilinear base class `~.axes.Axes` can be found in
932
+ This method also takes the keyword arguments for the returned axes
933
+ base class; except for the *figure* argument . The keyword arguments
934
+ for the rectilinear base class `~.axes.Axes` can be found in
935
935
the following table but there might also be other keyword
936
936
arguments if another projection is used.
937
937
You can’t perform that action at this time.
0 commit comments