Skip to content Skip to sidebar Skip to footer

Matplotlib Navigationtoolbar Embedded In Pyqt5

I am trying to add a NavigationToolbar to my tool. I managed to embed it in a widget but only the 'Save the figure' option (highlighted in green) works. The zoom and the edit optio

Solution 1:

You are not saving a reference to the toolbar, so I'm guessing it is being garbage collected.

Change the toolbar instantiation line to:

self.toolbar = NavigationToolbar(self.canvas, self)

EDIT: Consider following the pattern of this stack overflow answer (explicitly add the toolbar and canvas to a Qt layout, etc).

Post a Comment for "Matplotlib Navigationtoolbar Embedded In Pyqt5"