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

Skip to content

Improve paper size selection for PS backend #22796

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

Closed
wants to merge 1 commit into from

Conversation

oscargus
Copy link
Member

@oscargus oscargus commented Apr 7, 2022

PR Summary

Closes #7551
Closes #16657

Sorting based on size rather than name. Use <= for comparison, not <.

Not sure why l* sizes are skipped? Should one also skip b*?

Maybe use the case in #16657 to test this?

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus marked this pull request as draft April 7, 2022 13:16
@anntzer
Copy link
Contributor

anntzer commented Apr 7, 2022

Honestly it's not clear to me that autoselecting papersize (and thus changing the figure size) is a desirable feature? (Not to block the improvement here...) We could perhaps support e.g. figsize="a4" or similar and deprecate/remove papersize autoselection?

@oscargus
Copy link
Member Author

oscargus commented Apr 7, 2022

I agree. More like you pointed out in #7551: the selection logic is most likely incorrect. So it may not be the best way to support automatic selection, but now it at least works as one might expect it to.

I have not looked very deep into this, so I do not really know when the paper size is and when it is simply ignored... But I agree that it may be better to see if one can find a better approach to deal with this. (And if none has shown up for 3.6, one can revisit this.)

@tacaswell

This comment was marked as outdated.

@anntzer
Copy link
Contributor

anntzer commented Apr 7, 2022

The fact that it has never worked properly (likely for many many years) suggests that no one is really relying on this, though...

@timhoffm
Copy link
Member

timhoffm commented Apr 7, 2022

I'm inclined to merge something like this. Independent of if this is a good idea, we should at least do it in a non-broken way.

The fact that it has never worked properly (likely for many many years) suggests that no one is really relying on this, though...

Be careful here. It can well be that people have a specific figure size that selected a reasonable (maybe not optimal) page size. Or they might have set up some post processing to fix the size later. Changing, even if it is improving, would break those people. We should do this only once. Now changing the detection algorithm only to abandon it in the next release can cause extra migration pain. Let's decide once how this should be handled and stick with it.

@tacaswell
Copy link
Member

@timhoffm Fair. I take back my statement.

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 automatic papersize selection by ps backend is almost certainly broken
4 participants