hnn_core.viz.NetworkPlotter

class hnn_core.viz.NetworkPlotter(net, ax=None, vmin=-100, vmax=50, bg_color='black', colorbar=True, voltage_colormap='viridis', elev=10, azim=-500, xlim=(-200, 3100), ylim=(-200, 3100), zlim=(-300, 2200), trial_idx=0, time_idx=0)[source]

Helper class to visualize full morphology of HNN model.

Parameters:
netInstance of Network object

The Network object

axinstance of matplotlib Axes3D | None

An axis object from matplotlib. If None, a new figure is created.

vminint | float

Lower limit of colormap for plotting voltage Default: -100 mV

vmaxint | float

Upper limit of colormap for plotting voltage Default: 50 mV

bg_colorstr

Background color of ax. Default: ‘black’

colorbarbool

If True (default), adjust figure to include colorbar.

voltage_colormapstr

Colormap used for plotting voltages Default: ‘viridis’

elevint | float

Elevation 3D plot viewpoint, default: 10

azimint | float

Azimuth of 3D plot view point, default: 20

xlimtuple of int | tuple of float

x limits of plot window. Default (-200, 3100)

ylimtuple of int | tuple of float

y limits of plot window. Default (-200, 3100)

zlimtuple of int | tuple of float

z limits of plot window. Default (-300, 2200)

trial_idxint

Index of simulation trial plotted. Default: 0

time_idxint

Index of time point plotted. Default: 0

Attributes:
azim
bg_color
colorbar
elev
time_idx
trial_idx
vmax
vmin
voltage_colormap
xlim
ylim
zlim

Methods

export_movie(fname[, fps, dpi, decim, ...])

Export movie of network activity

export_movie(fname, fps=30, dpi=300, decim=10, interval=30, frame_start=0, frame_stop=None, writer='pillow')[source]

Export movie of network activity

Parameters:
fnamestr

Filename of exported movie

fpsint

Frames per second, default: 30

dpiint

Dots per inch, default: 300

decimint

Decimation factor for frames, default: 10

intervalint

Delay between frames, default: 30

frame_startint

Index of first frame, default: 0

frame_stopint | None

Index of last frame, default: None If None, entire simulation is animated

writerstr

Movie writer, default: ‘pillow’. Alternative movie writers can be found at https://matplotlib.org/stable/api/animation_api.html