self._plotWidget = None
self._sgPyQt = self._controller._sgPyQt
self._toolbar = None
+ self._statusbar = None
self._mplNavigationActions = {}
self._toobarMPL = None
self._grid = None
self._lastMarkerID = -1
self.update()
+ def onMove(self,event):
+ """ get the x and y pixel coords """
+
+ fmtXcoord = ".4f"
+ fmtYcoord = ".4f"
+
+ if self._axisXSciNotation : fmtXcoord = ".4e"
+ if self._axisYSciNotation : fmtYcoord = ".4e"
+
+ if event.inaxes:
+ self._statusbar.showMessage(
+ f"x, y = {event.xdata:{fmtXcoord}}, {event.ydata:{fmtYcoord}}")
+
def onPick(self, event):
""" MPL callback when picking
"""
self._mplNavigationActions[actionName] = act
self._plotWidget.setCentralWidget(self._mplCanvas)
self._toolbar = self._plotWidget.toolBar
+ self._statusbar = self._plotWidget.statusBar
self.populateToolbar()
self._popupMenu = QtWidgets.QMenu()
self._mplCanvas.customContextMenuRequested.connect(self.onContextMenu)
self._mplCanvas.mpl_connect('scroll_event', self.onScroll)
self._mplCanvas.mpl_connect('button_press_event', self.onMousePress)
+ self._mplCanvas.mpl_connect('motion_notify_event', self.onMove)
+
def populateToolbar(self):
# Action to dump view in a file