Skip to content

Commit c8c6fbd

Browse files
committed
Merge pull request #4943 from jrevans/issue15
FIX: qt backend has more draws than necessary
2 parents 09e044c + fb2e928 commit c8c6fbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/backends/backend_qt5agg.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ def paintEvent(self, e):
7171
In Qt, all drawing should be done inside of here when a widget is
7272
shown onscreen.
7373
"""
74-
FigureCanvasAgg.draw(self)
74+
# If we have not rendered the Agg backend yet, do so now.
75+
if not hasattr(self, 'renderer'):
76+
FigureCanvasAgg.draw(self)
7577

7678
# FigureCanvasQT.paintEvent(self, e)
7779
if DEBUG:

0 commit comments

Comments
 (0)