animatplot.blocks.Line

class animatplot.blocks.Line(*args, ax=None, t_axis=0, **kwargs)[source]

Animates a single line.

Accepts additional keyword arguments to be passed to matplotlib.axes.Axes.plot().

Parameters:
  • x (1D numpy array, list of 1D numpy arrays or a 2D numpy array, optional) – The x data to be animated. If 1D then will be constant over animation.
  • y (list of 1D numpy arrays or a 2D numpy array) – The y data to be animated.
  • ax (matplotlib.axes.Axes, optional) – The matplotlib axes to attach the block to. Defaults to matplotlib.pyplot.gca()
  • t_axis (int, optional) –

    The axis of the numpy array that represents time. Defaults to 0. No effect if x, y are lists of numpy arrays.

    The default is chosen to be consistent with:
    X, T = numpy.meshgrid(x, t)
  • **kwargs – Passed on to matplotlib.axes.Axes.plot.
line

matplotlib.lines.Line2D

ax

matplotlib.axes.Axes – The matplotlib axes that the block is attached to.

Notes

This block animates a single line - to animate multiple lines you must call this once for each line, and then animate all of the blocks returned by passing a list of those blocks to animatplot.Animation.

Methods

__init__ Initialize self.
__init__(*args, ax=None, t_axis=0, **kwargs)[source]

Initialize self. See help(type(self)) for accurate signature.