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

Skip to content

Commit a0245ff

Browse files
authored
Merge pull request #26979 from meeseeksmachine/auto-backport-of-pr-26959-on-v3.8.x
Backport PR #26959 on branch v3.8.x (Move papersize="auto" deprecation to backend_bases.)
2 parents af6828c + ed70897 commit a0245ff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,12 @@ def print_figure(
21232123
if dpi == 'figure':
21242124
dpi = getattr(self.figure, '_original_dpi', self.figure.dpi)
21252125

2126+
if kwargs.get("papertype") == 'auto':
2127+
# When deprecation elapses, remove backend_ps._get_papertype & its callers.
2128+
_api.warn_deprecated(
2129+
"3.8", name="papertype='auto'", addendum="Pass an explicit paper type, "
2130+
"'figure', or omit the *papertype* argument entirely.")
2131+
21262132
# Remove the figure manager, if any, to avoid resizing the GUI widget.
21272133
with cbook._setattr_cm(self, manager=None), \
21282134
self._switch_canvas_and_return_print_method(format, backend) \

lib/matplotlib/backends/backend_ps.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,9 +872,6 @@ def _print_figure(
872872
# find the appropriate papertype
873873
width, height = self.figure.get_size_inches()
874874
if papertype == 'auto':
875-
_api.warn_deprecated("3.8", name="papertype='auto'",
876-
addendum="Pass an explicit paper type, 'figure', or "
877-
"omit the *papertype* argument entirely.")
878875
papertype = _get_papertype(*orientation.swap_if_landscape((width, height)))
879876

880877
if is_eps or papertype == 'figure':
@@ -1058,9 +1055,6 @@ def _print_figure_tex(
10581055
self.figure.get_size_inches())
10591056
else:
10601057
if papertype == 'auto':
1061-
_api.warn_deprecated("3.8", name="papertype='auto'",
1062-
addendum="Pass an explicit paper type, or "
1063-
"omit the *papertype* argument entirely.")
10641058
papertype = _get_papertype(width, height)
10651059
paper_width, paper_height = papersize[papertype]
10661060

0 commit comments

Comments
 (0)