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

Skip to content

Commit 464f39b

Browse files
authored
Merge pull request #26959 from anntzer/psa
Move papersize="auto" deprecation to backend_bases.
2 parents 2cb8c6a + 0334c94 commit 464f39b

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
@@ -2105,6 +2105,12 @@ def print_figure(
21052105
if dpi == 'figure':
21062106
dpi = getattr(self.figure, '_original_dpi', self.figure.dpi)
21072107

2108+
if kwargs.get("papertype") == 'auto':
2109+
# When deprecation elapses, remove backend_ps._get_papertype & its callers.
2110+
_api.warn_deprecated(
2111+
"3.8", name="papertype='auto'", addendum="Pass an explicit paper type, "
2112+
"'figure', or omit the *papertype* argument entirely.")
2113+
21082114
# Remove the figure manager, if any, to avoid resizing the GUI widget.
21092115
with cbook._setattr_cm(self, manager=None), \
21102116
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
@@ -867,9 +867,6 @@ def _print_figure(
867867
# find the appropriate papertype
868868
width, height = self.figure.get_size_inches()
869869
if papertype == 'auto':
870-
_api.warn_deprecated("3.8", name="papertype='auto'",
871-
addendum="Pass an explicit paper type, 'figure', or "
872-
"omit the *papertype* argument entirely.")
873870
papertype = _get_papertype(*orientation.swap_if_landscape((width, height)))
874871

875872
if is_eps or papertype == 'figure':
@@ -1053,9 +1050,6 @@ def _print_figure_tex(
10531050
self.figure.get_size_inches())
10541051
else:
10551052
if papertype == 'auto':
1056-
_api.warn_deprecated("3.8", name="papertype='auto'",
1057-
addendum="Pass an explicit paper type, or "
1058-
"omit the *papertype* argument entirely.")
10591053
papertype = _get_papertype(width, height)
10601054
paper_width, paper_height = papersize[papertype]
10611055

0 commit comments

Comments
 (0)