Changes in src/sas/qtgui/Plotting/PlotterBase.py [d9150d8:863ebca] in sasview
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Plotting/PlotterBase.py
rd9150d8 r863ebca 10 10 11 11 import matplotlib.pyplot as plt 12 from matplotlib import rcParams 12 13 13 14 DEFAULT_CMAP = pylab.cm.jet … … 29 30 self.manager = manager 30 31 self.quickplot = quickplot 32 33 # Set auto layout so x/y axis captions don't get cut off 34 rcParams.update({'figure.autolayout': True}) 31 35 32 36 #plt.style.use('ggplot') … … 106 110 107 111 self.contextMenu = QtWidgets.QMenu(self) 108 112 self.toolbar = NavigationToolbar(self.canvas, self) 113 layout.addWidget(self.toolbar) 109 114 if not quickplot: 110 115 # Add the toolbar 111 self.toolbar = NavigationToolbar(self.canvas, self) 112 layout.addWidget(self.toolbar) 116 self.toolbar.show() 113 117 # Notify PlotHelper about the new plot 114 118 self.upatePlotHelper() 119 else: 120 self.toolbar.hide() 115 121 116 122 self.setLayout(layout) … … 215 221 self.actionCopyToClipboard = self.contextMenu.addAction("Copy to Clipboard") 216 222 self.contextMenu.addSeparator() 223 self.actionToggleMenu = self.contextMenu.addAction("Toggle Navigation Menu") 224 self.contextMenu.addSeparator() 225 217 226 218 227 # Define the callbacks … … 220 229 self.actionPrintImage.triggered.connect(self.onImagePrint) 221 230 self.actionCopyToClipboard.triggered.connect(self.onClipboardCopy) 231 self.actionToggleMenu.triggered.connect(self.onToggleMenu) 222 232 223 233 def createContextMenu(self): … … 367 377 self.manager.communicator.activeGraphName.emit((current_title, title)) 368 378 379 def onToggleMenu(self): 380 """ 381 Toggle navigation menu visibility in the chart 382 """ 383 if self.toolbar.isVisible(): 384 self.toolbar.hide() 385 else: 386 self.toolbar.show() 387 369 388 def offset_graph(self): 370 389 """
Note: See TracChangeset
for help on using the changeset viewer.