emodelrunner.GUI_utils.plotshape¶
Plot shape of neuron.
Functions
|
Sets the x, y, and z range symmetric around the center. |
|
Return color. |
|
Plots a 3D shapeplot. |
|
Plot shape and return line. |
|
Set labels. |
- emodelrunner.GUI_utils.plotshape.auto_aspect(ax)[source]¶
Sets the x, y, and z range symmetric around the center.
- Parameters:
ax (matplotlib.axes.Axes) – axis
- emodelrunner.GUI_utils.plotshape.get_color_from_cmap(val, val_min, val_max, cmap)[source]¶
Return color.
- Parameters:
val (float) – value to get color for from colormap (mV)
val_min (int) – minimum value of voltage for colormap (mV)
val_max (int) – minimum value of voltage for colormap (mV)
cmap (matplotlib.colors.Colormap) – colormap
- Returns:
tuple of RGBA values indicating a color
- Return type:
tuple
- emodelrunner.GUI_utils.plotshape.get_morph_lines(ax, sim, val_min=-90, val_max=30, sections=None, variable='v', cmap=matplotlib.cm.plasma, do_plot=False, plot_3d=False, threshold_volt=4, threshold_volt_fine=25, old_vals=None, vals_last_draw=None, xaxis=2, yaxis=0, zaxis=1, linewidth=0.9)[source]¶
Plots a 3D shapeplot.
- Parameters:
ax (matplotlib.axes.Axes) – axis
sim (bluepyopt.ephys.simulators.NrnSimulator) –
val_min (int) – minimum value of voltage for colormap (mV)
val_max (int) – minimum value of voltage for colormap (mV)
sections (list) list of h.Section() – If None, all sections are loaded.
variable (str) – variable to be plotted. ‘v’ for voltage.
cmap (matplotlib.colors.Colormap) – colormap
do_plot (bool) – True to plot data. False to get actualised data.
plot_3d (bool) – set to True to plot the shape in 3D
threshold_volt (int) – voltage difference from which color should be changed on the cell shape. (mV)
threshold_volt_fine (int) – voltage difference from which display should be updated after a small simulation time to fine display rapid changes. (mV)
old_vals (list) – variable values at the last display
vals_last_drawn (list) – variable values the last time the morphology has been drawn (and not blitted).
xaxis (int) – indicate which data to plot on the x-axis (0 for x, 1 for y, 2 for z)
yaxis (int) – indicate which data to plot on the y-axis (0 for x, 1 for y, 2 for z)
zaxis (int) – indicate which data to plot on the z-axis (0 for x, 1 for y, 2 for z)
linewidth (float) – width of line in shape plot
- Returns:
tuple containing
list: line objects making up shapeplot to update in figure
list: voltages previously plotted (mV)
bool: True to force the draw of figure, False to blit the figure
- emodelrunner.GUI_utils.plotshape.plot_shape(ax, xaxis, yaxis, zaxis, plot_3d, data, linewidth)[source]¶
Plot shape and return line.
- Parameters:
ax (matplotlib.axes.Axes) – axis
xaxis (int) – indicate which data to plot on the x-axis (0 for x, 1 for y, 2 for z)
yaxis (int) – indicate which data to plot on the y-axis (0 for x, 1 for y, 2 for z)
zaxis (int) – indicate which data to plot on the z-axis (0 for x, 1 for y, 2 for z)
plot_3d (bool) – whether to plot in 3d or 2d
data (list) – list of (xs, ys, zs, diams) for each segment
linewidth (float) – width of line in shape plot
- Returns:
the plotted line
- Return type:
matplotlib.lines.Line2D
- emodelrunner.GUI_utils.plotshape.set_labels(ax, xaxis, yaxis, zaxis, plot_3d)[source]¶
Set labels.
- Parameters:
ax (matplotlib.axes.Axes) – axis
xaxis (int) – indicate which label to set on the x-axis (0 for x, 1 for y, 2 for z)
yaxis (int) – indicate which label to set on the y-axis (0 for x, 1 for y, 2 for z)
zaxis (int) – indicate which label to set on the z-axis (0 for x, 1 for y, 2 for z)
plot_3d (bool) – whether to plot in 3d or 2d