brainpy.visualization.animate_2D(values, net_size, dt=None, val_min=None, val_max=None, cmap=None, frame_delay=10, frame_step=1, title_size=10, figsize=None, gif_dpi=None, video_fps=None, save_path=None, show=True)[source]

Animate the potentials of the neuron group.

  • values (np.ndarray) – The membrane potentials of the neuron group.

  • net_size (tuple) – The size of the neuron group.

  • dt (float) – The time duration of each step.

  • val_min (float, int) – The minimum of the potential.

  • val_max (float, int) – The maximum of the potential.

  • cmap (str) – The colormap.

  • frame_delay (int, float) – The delay to show each frame.

  • frame_step (int) – The step to show the potential. If frame_step=3, then each frame shows one of the every three steps.

  • title_size (int) – The size of the title.

  • figsize (None, tuple) – The size of the figure.

  • gif_dpi (int) – Controls the dots per inch for the movie frames. This combined with the figure’s size in inches controls the size of the movie. If None, use defaults in matplotlib.

  • video_fps (int) – Frames per second in the movie. Defaults to None, which will use the animation’s specified interval to set the frames per second.

  • save_path (None, str) – The save path of the animation.

  • show (bool) – Whether show the animation.


anim – The created animation function.

Return type