madgui.widget.plot module

Utilities to create plots using matplotlib via the Qt5Agg backend.

Classes

Toolbar(canvas, parent[, coordinates])

Toolbar that autoscales the figure when pressing the “Home” button.

PlotWidget([figure])

Widget containing a matplotlib figure and toolbar.

class madgui.widget.plot.PlotWidget(figure=None, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget containing a matplotlib figure and toolbar. It fixes the annoying cursor loading quirk of the original matplotlib widget and adds an API for adding mouse capture buttons in the toolbar.

Methods

addAction(self, QAction)

addCapture(mode, update)

addTool(tool)

endCapture(mode)

startCapture(mode, message)

Capture the mouse for the plot widget using the specified mode name.

addAction(self, QAction)[source]
addCapture(mode, update)[source]
addTool(tool)[source]
endCapture(mode)[source]
startCapture(mode, message)[source]

Capture the mouse for the plot widget using the specified mode name. This manages the toolbar’s active mouse mode and invokes the cleanup routine when another mode receives mouse capture (e.g. ZOOM/PAN).

class madgui.widget.plot.Toolbar(canvas, parent, coordinates=True)[source]

Bases: matplotlib.backends.backend_qt5.NavigationToolbar2QT

Toolbar that autoscales the figure when pressing the “Home” button.

Methods

home()

Restore the original view.

home()[source]

Restore the original view.