Skip to content

Commit c00bef1

Browse files
author
James Evans
committed
Removed an extra matplotlib draw that was happening on every paintEvent.
1 parent 7900ee4 commit c00bef1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/backends/backend_qt5agg.py

Lines changed: 3 additions & 1 deletion
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)