FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Deprecation removal/updates in axes3d by oscargus · Pull Request #22366 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
23 changes: 9 additions & 14 deletions lib/mpl_toolkits/mplot3d/axes3d.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ def __init__(
does not produce the desired result. Note however, that a manual
zorder will only be correct for a limited view angle. If the figure
is rotated by the user, it will look wrong from certain angles.
auto_add_to_figure : bool, default: True
auto_add_to_figure : bool, default: False
Prior to Matplotlib 3.4 Axes3D would add themselves
to their host Figure on init. Other Axes class do not
do this.

This behavior is deprecated in 3.4, the default will
change to False in 3.5. The keyword will be undocumented
and a non-False value will be an error in 3.6.
This behavior is deprecated in 3.4, the default is
changed to False in 3.6. The keyword will be undocumented
and a non-False value will be an error in 3.7.
focal_length : float, default: None
For a projection type of 'persp', the focal length of the virtual
camera. Must be > 0. If None, defaults to 1.
Expand Down Expand Up @@ -142,7 +142,7 @@ def __init__(
self._shared_axes["z"].join(self, sharez)
self._adjustable = 'datalim'

auto_add_to_figure = kwargs.pop('auto_add_to_figure', True)
auto_add_to_figure = kwargs.pop('auto_add_to_figure', False)

super().__init__(
fig, rect, frameon=True, box_aspect=box_aspect, *args, **kwargs
Expand Down Expand Up @@ -178,12 +178,12 @@ def __init__(

if auto_add_to_figure:
_api.warn_deprecated(
"3.4", removal="3.6", message="Axes3D(fig) adding itself "
"3.4", removal="3.7", message="Axes3D(fig) adding itself "
"to the figure is deprecated since %(since)s. "
"Pass the keyword argument auto_add_to_figure=False "
"and use fig.add_axes(ax) to suppress this warning. "
"The default value of auto_add_to_figure will change to "
"False in mpl3.5 and True values will "
"The default value of auto_add_to_figure is changed to "
"False in mpl3.6 and True values will "
"no longer work %(removal)s. This is consistent with "
"other Axes classes.")
fig.add_axes(self)
Expand Down Expand Up @@ -1617,12 +1617,7 @@ def plot_surface(self, X, Y, Z, *, norm=None, vmin=None,
cmap = kwargs.get('cmap', None)
shade = kwargs.pop('shade', cmap is None)
if shade is None:
_api.warn_deprecated(
"3.1",
message="Passing shade=None to Axes3D.plot_surface() is "
"deprecated since matplotlib 3.1 and will change its "
"semantic or raise an error in matplotlib 3.3. "
"Please use shade=False instead.")
raise ValueError("shade cannot be None.")

colset = [] # the sampled facecolor
if (rows - 1) % rstride == 0 and \
Expand Down
4 changes: 1 addition & 3 deletions lib/mpl_toolkits/tests/test_mplot3d.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d, art3d
import matplotlib as mpl
from matplotlib.backend_bases import MouseButton
from matplotlib.cbook import MatplotlibDeprecationWarning
from matplotlib import cm
from matplotlib import colors as mcolors
from matplotlib.testing.decorators import image_comparison, check_figures_equal
Expand Down Expand Up @@ -1266,8 +1265,7 @@ def test_inverted_cla():

def test_ax3d_tickcolour():
fig = plt.figure()
with pytest.warns(MatplotlibDeprecationWarning):
ax = Axes3D(fig)
ax = Axes3D(fig)

ax.tick_params(axis='x', colors='red')
ax.tick_params(axis='y', colors='red')
Expand Down

Back | FazBrowse Home | New Git URL