pyNAVIS.plots¶
Plots¶
- class pyNAVIS.plots.Plots[source]¶
Methods:
average_activity
(spikes_file, settings[, ...])Plots the average activity plot of a SpikesFile.
difference_between_LR
(spikes_file, settings)Plots a plot showing the differente between the left and the right activity of a SpikesFile.
histogram
(spikes_file, settings[, bar_line, ...])Plots the histogram of a SpikesFile.
sonogram
(spikes_file, settings[, ...])Plots the sonogram of a SpikesFile.
spikegram
(spikes_file, settings[, dot_size, ...])Plots the spikegram (also known as cochleogram or raster plot) of a SpikesFile.
- static average_activity(spikes_file, settings, graph_tile='Average activity', verbose=False)[source]¶
Plots the average activity plot of a SpikesFile.
This is, a graph where time is represented in the X axis, and average number of spikes in the Y axis.
- Parameters
spikes_file (SpikesFile) – File to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
graph_tile (string, optional) – Text that will appear as title for the graph.
verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.
- Returns
None.
- static difference_between_LR(spikes_file, settings, return_data=False, graph_tile='Diff. between L and R cochlea', verbose=False)[source]¶
Plots a plot showing the differente between the left and the right activity of a SpikesFile.
- Parameters
spikes_file (SpikesFile) – File to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
return_data (boolean, optional) – When set to True, the sonogram matrix will be returned instead of plotted.
graph_tile (string, optional) – Text that will appear as title for the graph.
verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.
- Returns
int[ , ] – Disparity matrix. Only returned if return_data is set to True.
- Raises
SettingsError – if settings.mono_stereo == 0
Note
This function can only be called if the mono_stereo parameter in settings is set to 1.
- static histogram(spikes_file, settings, bar_line=1, graph_tile='Histogram', verbose=False)[source]¶
Plots the histogram of a SpikesFile.
This is, a graph where addresses (or cochlea channels) are represented in the X axis, and number of spikes in the Y axis.
- Parameters
spikes_file (SpikesFile) – File to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
bar_line (int, optional) – Select wether to plot the histogram as bar plot (0) or as a line graph (1).
graph_tile (string, optional) – Text that will appear as title for the graph.
verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.
- Returns
None.
- static sonogram(spikes_file, settings, return_data=False, graph_tile='Sonogram', start_at_zero=True, verbose=False)[source]¶
Plots the sonogram of a SpikesFile.
This is, a graph where the X axis means time and the Y axis represents addresses (or cochlea channels), and where the spiking activity is shown with color.
- Parameters
spikes_file (SpikesFile) – File to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
return_data (boolean, optional) – When set to True, the sonogram matrix will be returned instead of plotted.
graph_tile (string, optional) – Text that will appear as title for the graph.
start_at_zero (boolean, optional) – If set to True, the X axis will start at 0, instead of starting at the minimum timestamp.
verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.
- Returns
int[ , ] – Sonogram matrix. Only returned if return_data is set to True.
- static spikegram(spikes_file, settings, dot_size=0.2, dot_freq=1, graph_tile='Spikegram', start_at_zero=True, verbose=False)[source]¶
Plots the spikegram (also known as cochleogram or raster plot) of a SpikesFile.
This is, a graph where the X axis means time and the Y axis represents addresses (or cochlea channels), and where every spike is plotted as a dot.
- Parameters
spikes_file (SpikesFile) – File to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
dot_size (float) – Size of the dots used in the spikegram plot.
dot_freq (int) – Set the frequency of spikes that will be represented in the spikegram.
graph_tile (string, optional) – Text that will appear as title for the graph.
start_at_zero (boolean, optional) – If set to True, the X axis will start at 0, instead of starting at the minimum timestamp.
verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.
- Returns
None.
Note
A value of 10 in dot_size means that for every 10 spikes, only 1 will be plotted. This helps reducing lag when plotting heavy files.