Commit 68498c6
committed
MNT: Remove deprecated axes kwargs collision detection
In Matplotlib 2.1, the behavior of reusing existing axes when
created with the same arguments was deprecated (see matplotlib#9037). This
behavior is now removed.
The behavior of the functions to create new axes (`pyplot.axes`,
`pyplot.subplot`, `figure.Figure.add_axes`,
`figure.Figure.add_subplot`) has changed. In the past, these
functions would detect if you were attempting to create Axes with
the same keyword arguments as already-existing axes in the current
figure, and if so, they would return the existing Axes. Now, these
functions will always create new Axes. A special exception is
`pyplot.subplot`, which will reuse any existing subplot with a
matching subplot spec. However, if there is a subplot with a
matching subplot spec, then that subplot will be returned, even if
the keyword arguments with which it was created differ.
Correspondingly, the behavior of the functions to get the current
Axes (`pyplot.gca`, `figure.Figure.gca`) has changed. In the past,
these functions accepted keyword arguments. If the keyword
arguments matched an already-existing Axes, then that Axes would
be returned, otherwise new Axes would be created with those
keyword arguments. Now, the keyword arguments are only considered
if there are no axes at all in the current figure. In a future
release, these functions will not accept keyword arguments at all.
Fixes matplotlib#18832.1 parent e6479bd commit 68498c6
File tree
9 files changed
+246
-286
lines changed- doc
- api/next_api_changes/deprecations
- users/next_whats_new
- lib
- matplotlib
- axes
- cbook
- tests
- mpl_toolkits/tests
9 files changed
+246
-286
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 144 | + | |
155 | 145 | | |
156 | 146 | | |
157 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
609 | 612 | | |
610 | 613 | | |
611 | 614 | | |
| |||
0 commit comments