line_plot

Contents

line_plot#

class braintools.visualize.line_plot(ts, val_matrix, plot_ids=None, ax=None, xlim=None, ylim=None, xlabel='Time (ms)', ylabel=None, legend=None, title=None, show=False, colors=None, alpha=1.0, linewidth=1.0, **kwargs)#

Show the specified value in the given object (Neurons or Synapses.)

Parameters:
  • ts (np.ndarray) – The time steps.

  • val_matrix (np.ndarray) – The value matrix which record the history trajectory. It can be easily accessed by specifying the monitors of NeuGroup/SynConn by: neu/syn = NeuGroup/SynConn(..., monitors=[k1, k2])

  • plot_ids (None, int, tuple, a_list) – The index of the value to plot.

  • ax (None, Axes) – The figure to plot.

  • xlim (list, tuple) – The xlim.

  • ylim (list, tuple) – The ylim.

  • xlabel (str) – The xlabel.

  • ylabel (str) – The ylabel.

  • legend (str) – The prefix of legend for plot.

  • show (bool) – Whether show the figure.

  • colors (list, optional) – Colors for each line.

  • alpha (float) – Alpha transparency value.

  • linewidth (float) – Width of lines.

  • **kwargs – Additional keyword arguments passed to plot().

Returns:

ax – The axes object containing the plot.

Return type:

matplotlib.axes.Axes

Raises:
  • TypeError – If plot_ids is not the correct type.

  • ValueError – If val_matrix is empty or incompatible dimensions.