liveplotter.plotrecorder.
PlotRecorder
(port=5155)[source]¶Bases: object
This is a ZMQ publisher
Parameters: | port (int) – The port number to publish data (and subscribe to data) |
---|
liveplotter.plotter.
PlotterBase
(var_name, port=5155, **init_kwargs)[source]¶Bases: multiprocessing.context.Process
This is a ZMQ subscriber.
To implement your own plotters, use this as your base class and implement functions plot_loop()
and
plot_once()
as described in their respective documentation
See provided implementations below in liveplotter.plotter_impls
Parameters: |
|
---|
init
()[source]¶This method is called after a new process has been created, and should be used to initialize everything that needs to be initialized in the new process (i.e. after the fork). Override this method to create fig, ax etc. as needed
NOTE: This method SHOULD assign the created figure to the class variable self.fig.
loop
(i)[source]¶The function that runs the loop. At each call, it listens for a new message of the appropriate topic/var_name
(given in the constructor). When it receives the message, it calls plot_loop()
Parameters: | i (int) – The plot iteration passed in by the matplotlib animation api call |
---|
plot_loop
(var_value, i)[source]¶This method is called each time the plot needs to be updated. This should return an iterable of matplotlib
matplotlib.artist.Artist
NOTE: This method should only use the local variables self.plt and self.fig etc. for plotting. Do not use global variables, since this can cause problems due to the multiprocessing being used (and matplotlib’s limited support for it)
Parameters: |
|
---|---|
Returns: | An iterable of |
liveplotter.plotter_impls.
GeneralPlotter
(var_name, port=5155, **init_kwargs)[source]¶Bases: liveplotter.plotter.PlotterBase
This does a live plot of a line of one (and only one) variable. Look at GeneralArrayPlotter
if you want
to plot multiple variables.
NOTE: None of its function should be called directly. These functions are indirectly called by PlotterBase
and PlotRecorder
init
(title=None, xlabel=None, ylabel=None, plot_frequency=10, **plot_kwargs)[source]¶The init function that is called once at the beginning.
Parameters: |
|
---|---|
Returns: | self |
plot_loop
(data, it)[source]¶The actual function that updates the data in the plot initialized in init()
Parameters: |
|
---|---|
Returns: |
liveplotter.plotter_impls.
GeneralArrayPlotter
(var_name, port=5155, **init_kwargs)[source]¶Bases: liveplotter.plotter.PlotterBase
This does a live plot of lines for multiple variables variable. Look at GeneralPlotter
if you want
to plot only a single variable.
NOTE: None of its function should be called directly. These functions are indirectly called by PlotterBase
and PlotRecorder
init
(title=None, xlabel=None, ylabel=None, plot_frequency=10, **plot_kwargs)[source]¶The init function that is called once at the beginning.
Parameters: |
|
---|---|
Returns: | self |
plot_loop
(data, it)[source]¶The actual function that updates the data in the plot initialized in init()
Parameters: |
|
---|---|
Returns: |
liveplotter.plotter_impls.
GeneralImagePlotter
(var_name, port=5155, **init_kwargs)[source]¶Bases: liveplotter.plotter.PlotterBase
This does a live plot of a 2-D image using matplotlib’s imshow
NOTE: None of its function should be called directly. These functions are indirectly called by PlotterBase
and PlotRecorder
init
(title=None, plot_frequency=10, **imshow_kwargs)[source]¶The init function that is called once at the beginning.
Parameters: |
|
---|---|
Returns: | self |
plot_loop
(image, it)[source]¶The actual function that updates the data in the plot initialized in init()
Parameters: |
|
---|---|
Returns: |
liveplotter.plotter_impls.
SpikePlotter
(var_name, port=5155, **init_kwargs)[source]¶Bases: liveplotter.plotter.PlotterBase
This is specifically for plotting “spikes” i.e. binary arrays of 0s and 1s, where the index denotes the spike source
NOTE: None of its function should be called directly. These functions are indirectly called by PlotterBase
and PlotRecorder
init
(title=None, xlabel=None, ylabel=None, plot_frequency=10, **plot_kwargs)[source]¶The init function that is called once at the beginning.
Parameters: |
|
---|---|
Returns: | self |
plot_loop
(data, it)[source]¶The actual function that updates the data in the plot initialized in init()
Parameters: |
|
---|---|
Returns: |