Skip to content

Commit 0e487fd

Browse files
committed
Pass 'figure' as kwarg to FigureCanvasQt5Agg super __init__.
Otherwise, creating FigureCanvas fails using PyQt4, PySide and PySide2 (because the super-class on Qt's side doesn't recognize the positional argument, but will happily forward keyword arguments).
1 parent 38476fd commit 0e487fd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/backends/backend_qt5agg.py

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
class FigureCanvasQTAgg(FigureCanvasAgg, FigureCanvasQT):
1717

18+
def __init__(self, figure):
19+
# Must pass 'figure' as kwarg to Qt base class.
20+
super().__init__(figure=figure)
21+
1822
def paintEvent(self, event):
1923
"""Copy the image from the Agg canvas to the qt.drawable.
2024

0 commit comments

Comments
 (0)