Recently, I began to study interface development in Qt Designer and editing them through PyQt. Everything is going pretty smoothly, but I'm currently stuck trying to solve the following problem:
I inserted the MatplotLib widget through Qt Designer and managed to build pretty good horizontal bars using barh. Then I tried and successfully removed the functional NavigationToolBar via matplotlib.backends.backend_qt4agg.NavigationToolbar2QT
Then, after this stream (and the like), I managed to edit which buttons I would like to display on the toolbar ... How easy is it to change the navigation bar in matplotlib Figure window?
This works well for every button except the last one, with a checkmark drawing that describes โEdit parameters of lines and axes of a curveโ. In this particular case, I would really like to remove this button, because it constantly changes the size of the graph when moving the mouse, and in this case I do not need this button.
I have not yet found a single discussion topic for this button on the toolbar (only this matplotlib: annoying Qt4Agg toolbar error )
The code currently used to insert the toolbar and edit buttons looks something like this:
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT class currentUI(QtGui.QWidget): def __init__(self): super(currentUI,self).__init__() (...) uic.loadUi('portfolioManager.ui',self) self.initUI() (...) def initUI(self): self.setWidgetsPropertiesAndActions() (...) def setWidgetsPropertiesAndActions(self): (...) self.navi_toolbar=NavigationToolbar(self.mplwidgetExposures, self) self.LayoutPlot.addWidget(self.navi_toolbar) (...) class NavigationToolbar(NavigationToolbar2QT): toolitems = [t for t in NavigationToolbar2QT.toolitems if t[0] in ('Home','Pan', 'Zoom', 'Save','Subplots')]
This successfully implements the toolbar, but the "edit" button remains.
Thank you for understanding. Relations