ps: Add option to use figure size as paper size by QuLogic · Pull Request #26479 · matplotlib/matplotlib · GitHub
Skip to content

ps: Add option to use figure size as paper size - #26479

Merged
ksunden merged 2 commits into
matplotlib:mainfrom
QuLogic:ps-papersize-figure
Aug 9, 2023
Merged

ksunden merged 2 commits into
matplotlib:mainfrom
QuLogic:ps-papersize-figure

Conversation

@QuLogic

@QuLogic QuLogic commented Aug 9, 2023

Copy link
Copy Markdown
Member

PR summary

We already set the bounding box to coincide with the figure size, but setting an overall paper size can sometimes cause the resulting file to be cropped by the viewer.

We additionally need to pass this through to the distiller.

Fixes #16657

PR checklist

@QuLogic

QuLogic commented Aug 9, 2023

Copy link
Copy Markdown
Member Author

@QuLogic
QuLogic marked this pull request as ready for review August 9, 2023 19:43
PostScript paper type defaults to figure size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The :rc:`ps.papertype` rcParam no longer defaults to 'letter' paper, but

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not match what the code does.

@QuLogic
QuLogic force-pushed the ps-papersize-figure branch from d2d5cd4 to f5d1dbe Compare August 9, 2023 20:15
@ksunden ksunden modified the milestones: v3.9.0, v3.8.0 Aug 9, 2023

@tacaswell tacaswell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

anyone can merge on green

We already set the bounding box to coincide with the figure size, but
setting an overall paper size can sometimes cause the resulting file to
be cropped by the viewer.

We additionally need to pass this through to the distiller.
@QuLogic
QuLogic force-pushed the ps-papersize-figure branch from f5d1dbe to 740c5d7 Compare August 9, 2023 20:30
When a distiller is not found, that step is simply skipped by
`_try_distill`, so these tests were not actually skipped as intended.
@QuLogic
QuLogic force-pushed the ps-papersize-figure branch from 5d0ec0e to 96b26fe Compare August 9, 2023 21:20
@QuLogic QuLogic changed the title ps: Default to using figure size as paper ps: Add option to use figure size as paper size Aug 9, 2023
@ksunden
ksunden merged commit 3ab6e1f into matplotlib:main Aug 9, 2023
@QuLogic
QuLogic deleted the ps-papersize-figure branch August 9, 2023 22:28
@ksunden

ksunden commented Aug 9, 2023

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Postscript backend gives wrong page sizes

3 participants