hnn_core.viz.plot_laminar_lfp#

hnn_core.viz.plot_laminar_lfp(times, data, contact_labels, tmin=None, tmax=None, ax=None, decim=None, color='cividis', voltage_offset=50, voltage_scalebar=200, show=True)[source]#

Plot laminar extracellular electrode array voltage time series.

Parameters:
timesarray-like, shape (n_times,)

Sampling times (in ms).

dataTwo-dimensional Numpy array

The extracellular voltages as an (n_contacts, n_times) array.

contact_labelslist

Labels associated with the contacts to plot. Passed as-is to set_yticklabels().

tminfloat, optional

Start time of the plot (in ms). If None, plots from the start.

tmaxfloat, optional

End time of the plot (in ms). If None, plots to the end.

axinstance of matplotlib figure, optional

The matplotlib axis.

decimint | list of int, optional

Optional (integer) factor by which to decimate the raw dipole traces. The SciPy function decimate() is used, which recommends values <13. To achieve higher decimation factors, a list of ints can be provided. These are applied successively.

colorstr | array of floats | matplotlib.colors.ListedColormap, default=’cividis’

The colormap to use for plotting. The usual Matplotlib standard colormap strings may be used (e.g., ‘jetblue’). A color can also be defined as an RGBA-quadruplet, or an array of RGBA-values (one for each electrode contact trace to plot). An instance of ListedColormap may also be provided.

voltage_offsetfloat, default=50

Amount to offset traces by on the voltage-axis (in uV). Useful for plotting laminar arrays.

voltage_scalebarfloat, default=200

Height (in uV) of a scale bar to plot in the top-left corner of the plot.

showbool, default=True

If True, show the figure.

Returns:
figinstance of plt.fig

The matplotlib figure handle into which time series were plotted.