mcstasscript.jb_interface.plot_interface.PlotInterface

mcstasscript.jb_interface.plot_interface.PlotInterface

class mcstasscript.jb_interface.plot_interface.PlotInterface(data=None)

Class for providing plotting interface given McStasScript data

__init__(data=None)

Initialize interface for exploring a dataset with plotting options

Parameters

data (List of McStasData objects) – Optional to set the data, otherwise use set_data method

Methods

__init__([data])

Initialize interface for exploring a dataset with plotting options

new_plot()

Sets up original plot with fig, ax and ax for colorbar

set_colormap(colormap)

Choose colormap, has to be available in matplotlib

set_current_monitor(monitor)

Selects a new monitor to be plotted

set_data(data)

Set a new dataset for the interface, and updates the plot

set_log_mode(log_mode)

Sets log mode for plotting, True or False

set_orders_of_mag(orders_of_mag)

Sets orders_of_mag value for logarithmic plots

show_interface()

Show the plot interface

update_plot()

Updates the plot with current data, monitor and plot options

new_plot()

Sets up original plot with fig, ax and ax for colorbar

set_colormap(colormap)

Choose colormap, has to be available in matplotlib

set_current_monitor(monitor)

Selects a new monitor to be plotted

set_data(data)

Set a new dataset for the interface, and updates the plot

Parameters

data (List of McStasData objects) – New dataset that will be plotted

set_log_mode(log_mode)

Sets log mode for plotting, True or False

set_orders_of_mag(orders_of_mag)

Sets orders_of_mag value for logarithmic plots

show_interface()

Show the plot interface

update_plot()

Updates the plot with current data, monitor and plot options

Threading lock is used as this method is used in a threading context and can easily fail if new data is written while plotting. The lock prevents this from happening.