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

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 9, 2023

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
Copy link
Member Author

QuLogic commented Aug 9, 2023

It's a bit of a smoke test, but I've added checks for the various combinations of ps output.

@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
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
Copy link
Member

@tacaswell tacaswell left a comment

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
Copy link
Member

ksunden commented Aug 9, 2023

Meant to squash merge to fix the commit message which incorrectly indicates the default changed, unfortunately forgot to do so and now it is not trivial to fix...

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