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.
mso_heatmap
(localization_file, ...[, ...])Plots the heatmap for the MSO activity extracted from a LocalizationFile.
mso_histogram
(localization_file, settings, ...)Plots the 3D histogram of the MSO information contained in a LocalizationFile.
mso_localization_plot
(localization_file, ...)Plots the result of the coincidence counters of the Jeffress model for the MSO according to the activity in the LocalizationFile.
mso_spikegram
(localization_file, settings, ...)Plots the 3D spikegram (also known as raster plot) of the MSO information contained in a LocalizationFile.
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_title='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_title (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[ ] average_activity_L – Average activity array. int[ ] average_activity_R: Average activity array. Only returned if the mono_stereo parameter in settings is set to 1
- static difference_between_LR(spikes_file, settings, return_data=False, graph_title='Diff. between L and R cochlea', verbose=False, start_at_zero=True)[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_title (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.
start_at_zero (boolean, optional) – If set to True, the X axis will start at 0, instead of starting at the minimum timestamp.
- 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_title='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_title (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[] – Histogram array.
- static mso_heatmap(localization_file, localization_settings, graph_title='MSO heatmap', enable_colorbar=True, verbose=False)[source]
Plots the heatmap for the MSO activity extracted from a LocalizationFile.
This is, a graph where the X axis means the neuron ID, the Y axis means the frequency channel to which the MSO neuron’s population are connected, and the color means the activity.
- Parameters:
localization_file (LocalizationFile) – Localization file to plot.
localization_settings (LocalizationSettings) – Localization configuration parameters for the file to plot.
graph_title (string, optional) – Text that will appear as title for the graph.
enable_colorbar (boolean, optional) – Set to True if you want to show the color bar that indicates the activity range by colors.
verbose (boolean, optional) – Set to True if you want the execution time of the function to be printed.
- Returns:
None.
Note
None.
- static mso_histogram(localization_file, settings, localization_settings, graph_title='MSO histogram', verbose=False)[source]
Plots the 3D histogram of the MSO information contained in a LocalizationFile.
This is, a graph where neuron IDs are represented in the X axis, frequency channels are represented in the Y axis, and number of spikes in the Z axis.
- Parameters:
localization_file (LocalizationFile) – Localization file to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
localization_settings (LocalizationSettings) – Localization configuration parameters for the file to plot.
graph_title (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.
Note
None.
- static mso_localization_plot(localization_file, settings, localization_settings, graph_title='MSO localization estimation', start_at_zero=True, verbose=False)[source]
Plots the result of the coincidence counters of the Jeffress model for the MSO according to the activity in the LocalizationFile.
This is, the neuron that fired the most in a time bin, thus indicating the sound source position.
- Parameters:
localization_file (LocalizationFile) – Localization file to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
localization_settings (LocalizationSettings) – Localization configuration parameters for the file to plot.
graph_title (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
None.
- static mso_spikegram(localization_file, settings, localization_settings, dot_size=0.2, graph_title='MSO spikegram', verbose=False)[source]
Plots the 3D spikegram (also known as raster plot) of the MSO information contained in a LocalizationFile. This is, a graph where the X axis represents neuron IDs, the Y axis means time, and the Z axis represents the frequency channels of the cochlea, and where every spike is plotted as a dot.
- Parameters:
localization_file (LocalizationFile) – Localization file to plot.
settings (MainSettings) – Configuration parameters for the file to plot.
localization_settings (LocalizationSettings) – Localization configuration parameters for the file to plot.
dot_size (float) – Size of the dots used in the spikegram plot.
graph_title (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.
Note
None.
- static sonogram(spikes_file, settings, return_data=False, graph_title='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_title (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_title='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_title (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_freq means that for every 10 spikes, only 1 will be plotted. This helps reducing lag when plotting heavy files.