Real-time Plotter

class pathsim.utils.realtimeplotter.RealtimePlotter(max_samples=None, update_interval=1, labels=[], x_label='', y_label='')[source]

Bases: object

Class that manages a realtime plotting window that can stream in x-y-data and update accordingly

Parameters:
  • max_samples (int) – maximum number of samples to plot

  • update_interval (float) – time in seconds between refreshs

  • labels (list[str]) – labels for plot traces

  • x_label (str) – label for x-axis

  • y_label (str) – label for y-axis

fig

internal figure of the realtime plotter

Type:

matplotlib.pyplot.figure

ax

internal axis of the realtime plotter

Type:

matplotlib.pyplot.axis

update_all(x, y)[source]

update the plot completely with new data

Parameters:
  • x (array[float]) – new x values to plot

  • y (array[float]) – new y values to plot

update(x, y)[source]

update the plot with new data

Parameters:
  • x (float) – new x value to add

  • y (float) – new y value to add

show()[source]
on_close(event)[source]