diff --git a/lib/matplotlib/backend_bases.py b/lib/matplotlib/backend_bases.py index c07ad692451e..54e974991854 100644 --- a/lib/matplotlib/backend_bases.py +++ b/lib/matplotlib/backend_bases.py @@ -2105,6 +2105,12 @@ def print_figure( if dpi == 'figure': dpi = getattr(self.figure, '_original_dpi', self.figure.dpi) + if kwargs.get("papertype") == 'auto': + # When deprecation elapses, remove backend_ps._get_papertype & its callers. + _api.warn_deprecated( + "3.8", name="papertype='auto'", addendum="Pass an explicit paper type, " + "'figure', or omit the *papertype* argument entirely.") + # Remove the figure manager, if any, to avoid resizing the GUI widget. with cbook._setattr_cm(self, manager=None), \ self._switch_canvas_and_return_print_method(format, backend) \ diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py index b59c571809d1..8d09fc1fe733 100644 --- a/lib/matplotlib/backends/backend_ps.py +++ b/lib/matplotlib/backends/backend_ps.py @@ -867,9 +867,6 @@ def _print_figure( # find the appropriate papertype width, height = self.figure.get_size_inches() if papertype == 'auto': - _api.warn_deprecated("3.8", name="papertype='auto'", - addendum="Pass an explicit paper type, 'figure', or " - "omit the *papertype* argument entirely.") papertype = _get_papertype(*orientation.swap_if_landscape((width, height))) if is_eps or papertype == 'figure': @@ -1053,9 +1050,6 @@ def _print_figure_tex( self.figure.get_size_inches()) else: if papertype == 'auto': - _api.warn_deprecated("3.8", name="papertype='auto'", - addendum="Pass an explicit paper type, or " - "omit the *papertype* argument entirely.") papertype = _get_papertype(width, height) paper_width, paper_height = papersize[papertype]