netpyne.plotting.plotTimeSeriesPSD module
- netpyne.plotting.plotTimeSeriesPSD.plotLFPPSD(PSDData=None, axis=None, timeRange=None, electrodes=['avg', 'all'], pop=None, separation=1.0, roundOffset=True, NFFT=256, noverlap=128, nperseg=256, minFreq=1, maxFreq=100, stepFreq=1, smooth=0, logy=False, normSignal=False, normPSD=False, filtFreq=False, filtOrder=3, detrend=False, transformMethod='morlet', orderInverse=True, legend=True, colorList=None, returnPlotter=False, **kwargs)[source]
Function to produce a line plot of LFP electrode signals
- NetPyNE Options:
sim (NetPyNE sim object) – The sim object from which to get data.
Default:
None
uses the current NetPyNE sim object- Parameters:
PSDData (dict, str) –
The data necessary to plot the LFP PSD.
Default:
None
usesanalysis.preparePSD
to producePSDData
using the current NetPyNE sim object.If a str it must represent a file path to previously saved data.
axis (matplotlib axis) –
The axis to plot into, allowing overlaying of plots.
Default:
None
produces a new figure and axis.timeRange (list) –
Time range to include in the raster:
[min, max]
.Default:
None
uses the entire simulationelectrodes (list) –
A list of the electrodes to plot from.
Default:
['avg', 'all']
plots each electrode as well as their averagepop (str) –
A population name to calculate PSD from.
Default:
None
uses all populations.separation (float) –
Use to increase or decrease distance between signals on the plot.
Default:
1.0
roundOffset (bool) –
Attempts to line up PSD signals with gridlines
Default:
True
NFFT (int (power of 2)) – Number of data points used in each block for the PSD and time-freq FFT. Default:
256
noverlap (int (<nperseg)) – Number of points of overlap between segments for PSD and time-freq. Default:
128
nperseg (int) – Length of each segment for time-freq. Default:
256
minFreq (float) – Minimum frequency shown in plot for PSD and time-freq. Default:
1
maxFreq (float) – Maximum frequency shown in plot for PSD and time-freq. Default:
100
stepFreq (float) – Step frequency. Default:
1
smooth (int) – Window size for smoothing LFP; no smoothing if
0
Default:0
logy (bool) –
Whether to use a log axis.
Default:
False
normSignal (bool) –
Whether to normalize the LFP data.
Default:
False
normPSD (bool) –
Whether to normalize the PSD data.
Default:
False
filtFreq (int or list) –
Frequency for low-pass filter (int) or frequencies for bandpass filter in a list: [low, high]
Default:
None
does not filter the datafiltOrder (int) –
Order of the filter defined by filtFreq.
Default:
3
detrend (bool) –
Whether to detrend the data.
Default:
False
transformMethod (str) –
The transformation method to use, either ‘morlet’ or ‘fft’.
Default:
'morlet'
orderInverse (bool) –
Whether to invert the order of plotting.
Default:
True
legend (bool) –
Whether or not to add a legend to the plot.
Default:
True
adds a legend.colorList (list) –
A list of colors to draw from when plotting.
Default:
None
uses the default NetPyNE colorList.returnPlotter (bool) –
Whether to return the figure or the NetPyNE MetaFig object.
Default:
False
returns the figure.
- Plot Options:
showFig (bool) – Whether to show the figure.
Default:
False
saveFig (bool) – Whether to save the figure.
Default:
False
overwrite (bool) – whether to overwrite existing figure files.
Default:
True
overwrites the figure fileOptions:
False
adds a number to the file name to prevent overwritinglegendKwargs (dict) – a dict containing any or all legend kwargs. These include
'title'
,'loc'
,'fontsize'
,'bbox_to_anchor'
,'borderaxespad'
, and'handlelength'
.rcParams (dict) – a dict containing any or all matplotlib rcParams. To see all options, execute
import matplotlib; print(matplotlib.rcParams)
in Python. Any options in this dict will be used for this current figure and then returned to their prior settings.title (str) – the axis title
xlabel (str) – label for x-axis
ylabel (str) – label for y-axis
linewidth (int) – line width
alpha (float) – line opacity (0-1)
- Returns:
LFPPSDPlot – By default, returns the figure. If
returnPlotter
isTrue
, instead returns the NetPyNE MetaFig.- Return type:
matplotlib figure
- netpyne.plotting.plotTimeSeriesPSD.plotCSDPSD(PSDData=None, LFPData=None, axis=None, timeRange=None, electrodes=['avg', 'all'], pop=None, separation=1.0, roundOffset=True, NFFT=256, noverlap=128, nperseg=256, minFreq=1, maxFreq=100, stepFreq=1, smooth=0, logy=False, normSignal=False, normPSD=False, filtFreq=False, filtOrder=3, detrend=False, transformMethod='morlet', orderInverse=True, legend=True, colorList=None, returnPlotter=False, **kwargs)[source]
Function to produce a line plot of LFP electrode signals
- NetPyNE Options:
sim (NetPyNE sim object) – The sim object from which to get data.
Default:
None
uses the current NetPyNE sim object- Parameters:
PSDData (dict, str) –
The data necessary to plot the LFP PSD.
Default:
None
usesanalysis.preparePSD
to producePSDData
using the current NetPyNE sim object.If a str it must represent a file path to previously saved data.
axis (matplotlib axis) –
The axis to plot into, allowing overlaying of plots.
Default:
None
produces a new figure and axis.timeRange (list) –
Time range to include in the raster:
[min, max]
.Default:
None
uses the entire simulationelectrodes (list) –
A list of the electrodes to plot from.
Default:
['avg', 'all']
plots each electrode as well as their averagepop (str) –
A population name to calculate PSD from.
Default:
None
uses all populations.separation (float) –
Use to increase or decrease distance between signals on the plot.
Default:
1.0
roundOffset (bool) –
Attempts to line up PSD signals with gridlines
Default:
True
NFFT (int (power of 2)) – Number of data points used in each block for the PSD and time-freq FFT. Default:
256
noverlap (int (<nperseg)) – Number of points of overlap between segments for PSD and time-freq. Default:
128
nperseg (int) – Length of each segment for time-freq. Default:
256
minFreq (float) – Minimum frequency shown in plot for PSD and time-freq. Default:
1
maxFreq (float) – Maximum frequency shown in plot for PSD and time-freq. Default:
100
stepFreq (float) – Step frequency. Default:
1
smooth (int) – Window size for smoothing LFP; no smoothing if
0
Default:0
logy (bool) –
Whether to use a log axis.
Default:
False
normSignal (bool) –
Whether to normalize the LFP data.
Default:
False
normPSD (bool) –
Whether to normalize the PSD data.
Default:
False
filtFreq (int or list) –
Frequency for low-pass filter (int) or frequencies for bandpass filter in a list: [low, high]
Default:
None
does not filter the datafiltOrder (int) –
Order of the filter defined by filtFreq.
Default:
3
detrend (bool) –
Whether to detrend the data.
Default:
False
transformMethod (str) –
The transformation method to use, either ‘morlet’ or ‘fft’.
Default:
'morlet'
orderInverse (bool) –
Whether to invert the order of plotting.
Default:
True
legend (bool) –
Whether or not to add a legend to the plot.
Default:
True
adds a legend.colorList (list) –
A list of colors to draw from when plotting.
Default:
None
uses the default NetPyNE colorList.returnPlotter (bool) –
Whether to return the figure or the NetPyNE MetaFig object.
Default:
False
returns the figure.
- Plot Options:
showFig (bool) – Whether to show the figure.
Default:
False
saveFig (bool) – Whether to save the figure.
Default:
False
overwrite (bool) – whether to overwrite existing figure files.
Default:
True
overwrites the figure fileOptions:
False
adds a number to the file name to prevent overwritinglegendKwargs (dict) – a dict containing any or all legend kwargs. These include
'title'
,'loc'
,'fontsize'
,'bbox_to_anchor'
,'borderaxespad'
, and'handlelength'
.rcParams (dict) – a dict containing any or all matplotlib rcParams. To see all options, execute
import matplotlib; print(matplotlib.rcParams)
in Python. Any options in this dict will be used for this current figure and then returned to their prior settings.title (str) – the axis title
xlabel (str) – label for x-axis
ylabel (str) – label for y-axis
linewidth (int) – line width
alpha (float) – line opacity (0-1)
- Returns:
LFPPSDPlot – By default, returns the figure. If
returnPlotter
isTrue
, instead returns the NetPyNE MetaFig.- Return type:
matplotlib figure