FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FIX: Make sure a renderer gets attached to figure after draw by greglucas · Pull Request #21758 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion lib/matplotlib/backends/backend_macosx.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _draw(self):

def draw(self):
# docstring inherited
self.draw_idle()
self._draw()
self.flush_events()

# draw_idle is provided by _macosx.FigureCanvas
Expand Down
20 changes: 20 additions & 0 deletions lib/matplotlib/tests/test_backend_macosx.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pytest

import matplotlib.pyplot as plt


pytest.importorskip("matplotlib.backends.backend_macosx",
reason="These are mac only tests")


@pytest.mark.backend('macosx')
def test_cached_renderer():
# Make sure that figures have an associated renderer after
# a fig.canvas.draw() call
fig = plt.figure(1)
fig.canvas.draw()
assert fig._cachedRenderer is not None

fig = plt.figure(2)
fig.draw_without_rendering()
assert fig._cachedRenderer is not None

Back | FazBrowse Home | New Git URL