online_plot_base

Classes

OnlinePlotBase()

Class to handle creation and management of Matplotlib figures to monitor behavioral data in real-time.

class OnlinePlotBase[source]

Bases: object

Class to handle creation and management of Matplotlib figures to monitor behavioral data in real-time.

Use this with the variables you are registering in your task, that are part of Task.session_df.

Subclasses should override create_figure_and_axes (to create axes) and update_plot (to draw on existing axes).

ensure_figure() None[source]

Ensures that the matplotlib figure exists, creating it if necessary.

close() None[source]

Closes the matplotlib figure and resets the state.

update_canvas(df: pandas.DataFrame) None[source]

Updates the plot with new data and redraws the canvas.

Parameters:

df (pd.DataFrame) – The dataframe containing the latest session data.

create_figure_and_axes() None[source]

Creates the figure and axes. Should be overridden by subclasses.

update_plot(df: pandas.DataFrame) None[source]

Updates the plot content. Should be overridden by subclasses.

Parameters:

df (pd.DataFrame) – The dataframe containing the latest session data.