Set of widgets to associate with a :class:’PlotWidget’.
Bases: PyQt4.QtGui.QWidget
QWidget displaying coords converted from data coords of the mouse.
Provide this widget with a list of couple:
To run the following sample code, a QApplication must be initialized. First, create a PlotWindow and add a QToolBar where to place the PositionInfo widget.
>>> from silx.gui.plot import PlotWindow
>>> from silx.gui import qt
>>> plot = PlotWindow() # Create a PlotWindow to add the widget to
>>> toolBar = qt.QToolBar() # Create a toolbar to place the widget in
>>> plot.addToolBar(qt.Qt.BottomToolBarArea, toolBar) # Add it to plot
Then, create the PositionInfo widget and add it to the toolbar. The PositionInfo widget is created with a list of converters, here to display polar coordinates of the mouse position.
>>> import numpy
>>> from silx.gui.plot.PlotTools import PositionInfo
>>> position = PositionInfo(plot=plot, converters=[
... ('Radius', lambda x, y: numpy.sqrt(x*x + y*y)),
... ('Angle', lambda x, y: numpy.degrees(numpy.arctan2(y, x)))])
>>> toolBar.addWidget(position) # Add the widget to the toolbar
<...>
>>> plot.show() # To display the PlotWindow with the position widget
Parameters: |
|
---|
Toggle snapping use position to active curve.
The PlotWindow this widget is attached to.
Bases: PyQt4.QtGui.QToolBar
QToolBar displaying and controlling the limits of a PlotWidget.
To run the following sample code, a QApplication must be initialized. First, create a PlotWindow:
>>> from silx.gui.plot import PlotWindow
>>> plot = PlotWindow() # Create a PlotWindow to add the toolbar to
Then, create the LimitsToolBar and add it to the PlotWindow.
>>> from silx.gui import qt
>>> from silx.gui.plot.PlotTools import LimitsToolBar
>>> toolbar = LimitsToolBar(plot=plot) # Create the toolbar
>>> plot.addToolBar(qt.Qt.BottomToolBarArea, toolbar) # Add it to the plot
>>> plot.show() # To display the PlotWindow with the limits toolbar
Parameters: |
|
---|