Scatter Plot¶
ScatterPlotWidget¶
Higher level widget that is directly used by the end-user. Scatter plot with docked Control Widget, Datapoint Tracer, and Console.
- class mesmerize.plotting.ScatterPlotWidget[source]¶
Bases:
QMainWindow
,BasePlotWidget
- live_datapoint_tracer¶
Instance of DatapointTracer
- set_input(*args, **kwds)¶
Set the input Transmission with data to plot
- Parameters:
transmission – Input transmission
- get_plot_opts(drop: bool = False) dict [source]¶
Get the plot options
- Parameters:
drop – no drop opts are specified for this plot
- set_plot_opts(*args, **kwds)¶
Must be implemented in subclass
- set_current_datapoint(identifier: UUID)[source]¶
Set the UUID of the current datapoint and update the Datapoint Tracer
- property transmission: Transmission¶
The input transmission
- Return type:
- save_plot_dialog(path, *args)¶
Plot save dialog
- save_plot(path)¶
Save the plot as a Transmission in an HDF5 file. Plot parameters are stored as a JSON string within the HDF5 file. See Transmission.to_hdf5
- Parameters:
path – Path to save the file to. For easy identification use “.ptrn” extension.
- open_plot_dialog(filepath, dirpath, *args, **kwargs)¶
Open plot dialog
Variant¶
Lower level widget that interfaces with pqytgraph.ScatterPlotItem and has some helper methods.
- class mesmerize.plotting.variants.PgScatterPlot(graphics_view: GraphicsLayoutWidget, parent=None)[source]¶
Bases:
QObject
- signal_spot_clicked¶
Emits the UUID of a spot when it is clicked
- __init__(graphics_view: GraphicsLayoutWidget, parent=None)[source]¶
- Parameters:
graphics_view – This plot will instantiate within this GraphicsLayoutWidget
- add_data(xs: ndarray, ys: ndarray, uuid_series: Series, color: Union[str, QColor, QBrush, List[Union[QBrush, QColor, str]]], size: int = 10, **kwargs)[source]¶
Add data to the plot
- Parameters:
xs (np.ndarray) – array of x values, indices must correspond to the “ys” array
ys (np.ndarray) – array of y values, indices must correspond to the “xs” array
uuid_series (pd.Series) – series of UUID values. Each SpotItem on the plot is tagged with these UUIDs, therefore the indices must correspond to the “xs” and “ys” arrays.
color (Union[str, QtGui.QColor, QtGui.QBrush, List[Union[QtGui.QBrush, QtGui.QColor, str]]]) – Either a single color or list of colors that pqytgraph.fn.mkBrush() can accept
size (int) – spot size
kwargs – any additional kwargs that are passed to ScatterPlotItem.addPoints()