-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Deprecate papersize=auto in PostScript #25785
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
Conversation
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.
This automation is not very good, and just saving at the figure size is better for EPS. Closes matplotlib#7551
papersize[papertype]) | ||
|
||
if mpl.rcParams['ps.usedistiller']: | ||
# distillers improperly clip eps files if pagesize is too small |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment seems incongruous with this being in the else
block of if is_eps:
If this code is specifically targeted to fix eps, then it would have to be in the if block, and if it is just wrong, perhaps it could be taken out entirely.
It also relies on the _get_papertype
function which the point of removing auto
is to remove that function because it is problematic in implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point, since as the first commit notes, the distiller ignores the paper type and asks the distiller to crop, this is probably something that could be dropped. But I guess I will have to test out a few combinations to be sure.
I know you discussed this yesterday, which I missed, but is the thing that "auto" selects one of the defined papersizes (in an incorrect way sometimes), but not passing anything will use a large enough paper and crop it? I sort of got that it will use letter then, which may not always be large enough? |
I've kind of forgotten how this works a bit, so I've gone and re-read everything. For For non- |
Plan is to:
|
@tacaswell Do you want to open another issue to track the work to do on your comment above? |
I think that's covered by #16657 but I'm also working on it right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been 25785 I just noted...
PR Summary
This automatic selection is not very good, and it's probably better for the user to explicitly select a paper type.
Additionally, I've corrected an inconsistency in EPS, which used the paper size only if not using
usetex
and no distiller. In the latter cases, the paper size is ignored and the distiller is told to use-dEPSCrop
instead. So this makes the former case consistent with those.PR Checklist
Linked Issue
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst