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

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,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) \
Expand Down
6 changes: 0 additions & 6 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,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':
Expand Down Expand Up @@ -1058,9 +1055,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]

Expand Down