Skip to content

Disable draw_foo methods on renderer used to estimate tight extents. #16734

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 1 commit into from
Mar 14, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Mar 11, 2020

For the pgf backend, in particular draw_image() cannot succeed because
that needs actual filesystem access (to set up \includegraphics).

I think this is a better solution than #16732 to close #16731, and should work both on master and backported to 3.2.

Note that this disabling of draw_foo methods was already done previously, in a piecemeal fashion, at https://github.com/matplotlib/matplotlib/blob/v3.2.0/lib/matplotlib/backends/backend_pgf.py#L422 or (in a different fashion) at https://github.com/matplotlib/matplotlib/blob/v3.2.0/lib/matplotlib/backends/backend_ps.py#L924.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Mar 11, 2020
@anntzer anntzer added this to the v3.2.1 milestone Mar 11, 2020
@anntzer anntzer mentioned this pull request Mar 11, 2020
6 tasks
@QuLogic
Copy link
Member

QuLogic commented Mar 12, 2020

Doesn't the renderer get cached, and thus needs these methods restored?

@anntzer
Copy link
Contributor Author

anntzer commented Mar 12, 2020

The renderer gets swapped out later (in print_method) by a real one. This was already the case before: the dryrun renderer would likewise first be cached for tight bbox computations, then swapped out by print_method.

For the pgf backend, in particular draw_image() cannot succeed because
that needs actual filesystem access (to set up \includegraphics).
@QuLogic QuLogic merged commit 4d8063f into matplotlib:master Mar 14, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Mar 14, 2020
QuLogic added a commit that referenced this pull request Mar 14, 2020
…734-on-v3.2.x

Backport PR #16734 on branch v3.2.x (Disable draw_foo methods on renderer used to estimate tight extents.)
@anntzer anntzer deleted the tightdisabledraw branch March 14, 2020 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PGF backend + savefig.bbox results in I/O error in 3.2
4 participants