Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf02034

Browse filesBrowse files
committed
Ignore papersize when outputting plain EPS
When usetex is enabled, then EPS ignores the papersize passed to `savefig` / `rcParams`. Additionally, when distilling, if outputting EPS, the papersize is ignored. This makes things consistent when not using usetex and not distilling.
1 parent f9b59bc commit cf02034
Copy full SHA for cf02034

File tree

Expand file treeCollapse file tree

1 file changed

+13
-9
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+13
-9
lines changed

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+13-9Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,16 +869,20 @@ def _print_figure(
869869
if papertype == 'auto':
870870
papertype = _get_papertype(
871871
*orientation.swap_if_landscape((width, height)))
872-
paper_width, paper_height = orientation.swap_if_landscape(
873-
papersize[papertype])
874872

875-
if mpl.rcParams['ps.usedistiller']:
876-
# distillers improperly clip eps files if pagesize is too small
877-
if width > paper_width or height > paper_height:
878-
papertype = _get_papertype(
879-
*orientation.swap_if_landscape((width, height)))
880-
paper_width, paper_height = orientation.swap_if_landscape(
881-
papersize[papertype])
873+
if is_eps:
874+
paper_width, paper_height = width, height
875+
else:
876+
paper_width, paper_height = orientation.swap_if_landscape(
877+
papersize[papertype])
878+
879+
if mpl.rcParams['ps.usedistiller']:
880+
# distillers improperly clip eps files if pagesize is too small
881+
if width > paper_width or height > paper_height:
882+
papertype = _get_papertype(
883+
*orientation.swap_if_landscape((width, height)))
884+
paper_width, paper_height = orientation.swap_if_landscape(
885+
papersize[papertype])
882886

883887
# center the figure on the paper
884888
xo = 72 * 0.5 * (paper_width - width)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.