3D Matplotlib plot not interactive

Hi,

great tutorial! I had an issue with 3d plot not being interactive in PyQt5. Swapping the super-constructor call and the add_subplot call fixes the issue (as below).

   def __init__(self, parent=None, width=5, height=4, dpi=100):
        self.fig = Figure(figsize=(width, height), dpi=dpi)
        super(MplCanvas, self).__init__(self.fig)
        self.axes = self.fig.add_subplot(111)

credit: python - Embed an interactive 3D plot in PySide - Stack Overflow

Cheers

1 Like