Skip to content
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

FIX: Make sure a renderer gets attached to figure after draw #21758

Merged
merged 1 commit into from
Nov 28, 2021

Conversation

greglucas
Copy link
Contributor

@greglucas greglucas commented Nov 26, 2021

PR Summary

Make sure that a cached renderer gets added to the figure after calling fig.canvas.draw() on the macosx backend. This changes the draw path to go through adding a renderer to the figure first.

closes #19197
closes #13968
closes #7550

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).

Make sure that a cached renderer gets added to the figure after
calling fig.canvas.draw()
@tacaswell tacaswell added this to the v3.5.1 milestone Nov 26, 2021
@tacaswell
Copy link
Member

This is legacy from when the OSX backend was not Agg based, but was implemented on top of the OSX native drawing API. In that API we could only get a graphics context inside of the UI draw loop, hence we had to use draw_idle and force the UI event loop to spin. Now that the OSX backend is Agg based, we do not have this restriction and can make OSX behave more in line with the other Agg-based GUI backends.

@dstansby dstansby merged commit 171e74a into matplotlib:main Nov 28, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 28, 2021
@greglucas greglucas deleted the macosx-fig-draw branch November 28, 2021 14:57
dstansby added a commit that referenced this pull request Nov 28, 2021
…758-on-v3.5.x

Backport PR #21758 on branch v3.5.x (FIX: Make sure a renderer gets attached to figure after draw)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants