Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ca24a6f

Browse files
author
Oscar Gustafsson
committed
Change default of auto_add_to_figure
1 parent d5681db commit ca24a6f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def __init__(
101101
to their host Figure on init. Other Axes class do not
102102
do this.
103103
104-
This behavior is deprecated in 3.4, the default will
105-
change to False in 3.5. The keyword will be undocumented
106-
and a non-False value will be an error in 3.6.
104+
This behavior is deprecated in 3.4, the default is
105+
changed to False in 3.6. The keyword will be undocumented
106+
and a non-False value will be an error in 3.7.
107107
focal_length : float, default: None
108108
For a projection type of 'persp', the focal length of the virtual
109109
camera. Must be > 0. If None, defaults to 1.
@@ -142,7 +142,7 @@ def __init__(
142142
self._shared_axes["z"].join(self, sharez)
143143
self._adjustable = 'datalim'
144144

145-
auto_add_to_figure = kwargs.pop('auto_add_to_figure', True)
145+
auto_add_to_figure = kwargs.pop('auto_add_to_figure', False)
146146

147147
super().__init__(
148148
fig, rect, frameon=True, box_aspect=box_aspect, *args, **kwargs
@@ -178,12 +178,12 @@ def __init__(
178178

179179
if auto_add_to_figure:
180180
_api.warn_deprecated(
181-
"3.4", removal="3.6", message="Axes3D(fig) adding itself "
181+
"3.4", removal="3.7", message="Axes3D(fig) adding itself "
182182
"to the figure is deprecated since %(since)s. "
183183
"Pass the keyword argument auto_add_to_figure=False "
184184
"and use fig.add_axes(ax) to suppress this warning. "
185185
"The default value of auto_add_to_figure will change to "
186-
"False in mpl3.5 and True values will "
186+
"False in mpl3.6 and True values will "
187187
"no longer work %(removal)s. This is consistent with "
188188
"other Axes classes.")
189189
fig.add_axes(self)

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,8 +1266,7 @@ def test_inverted_cla():
12661266

12671267
def test_ax3d_tickcolour():
12681268
fig = plt.figure()
1269-
with pytest.warns(MatplotlibDeprecationWarning):
1270-
ax = Axes3D(fig)
1269+
ax = Axes3D(fig)
12711270

12721271
ax.tick_params(axis='x', colors='red')
12731272
ax.tick_params(axis='y', colors='red')

0 commit comments

Comments
 (0)