schrodinger.ui.qt.matplot_widget module¶
- class schrodinger.ui.qt.matplot_widget.MatplotCanvas¶
Bases:
matplotlib.backends.backend_qtagg.FigureCanvasQTAgg
This is the class to represent FigureCanvas widget
- __init__()¶
- class schrodinger.ui.qt.matplot_widget.MatplotWidget(parent=None)¶
Bases:
PyQt6.QtWidgets.QWidget
This is a widget defined in Qt Designer
- __init__(parent=None)¶
- class schrodinger.ui.qt.matplot_widget.StructureTooltipMixin¶
Bases:
object
A class that enables tooltip on matplotlib plots.
Derived classes might need to re-define showToolTip(), findPoint() and addDataSet().
- TOOLTIP_SHOW_DELAY = 300¶
- TOOLTIP_HIDE_DELAY = 0¶
- __init__()¶
- showToolTip()¶
Constructs and displays the tooltip. Should be re-defined as needed in derived classes.
- hideToolTip()¶
Hide and remove the current tooltip, stops the show timer if still running
- addDataSet(ds)¶
Adds data sets. The reason it is a list of data sets is primarily to work with projplot.PlotWindow. In the case of multiple sets, derived class should overwrite findPoint method.
- Parameters
ds (list of 2-element tuples. [(x1, y1), (x2, y2), ...] Derived class can use its own type of data sets.) – Data set to add.
- mouseMove(event)¶
A mouse move event handler used to pick points in the plot
- findPoint(event)¶
Takes care of all the stuff needed if the data point is found. Might need to redefine in derived classes.
- Parameters
event (matplotlib.backend_bases.Event) – mouse event
- Returns
Whether the point at the mouse event is found
- Return type
bool