The StaticArtist Class and Subclasses

class src.matnimation.artist.static.static_artist.StaticArtist(name: str)

Bases: BaseArtist

__init__(name: str)

Initialize a StaticArtist object.

Parameters:

name (str) – Name of the static artist

update_timestep(time_index: int)

Update the static artist for a specific time index.

This method is intended to be overridden by subclasses if needed.

Parameters:

time_index (int) – Index representing the time step

class src.matnimation.artist.static.static_circle.StaticCircle(name: str, radius: float, xy_center: tuple[float])

Bases: StaticArtist

__init__(name: str, radius: float, xy_center: tuple[float])

Initialize a StaticCircle object.

Parameters:
  • name (str) – Name of the static circle

  • radius (float) – Radius of the circle

  • xy_center (tuple[float]) – (x, y) coordinates of the center of the circle

class src.matnimation.artist.static.static_colorbar.StaticColorBar(name: str, imshow: StaticImshow | AnimatedImshow, styling_dict: dict | None = None)

Bases: StaticArtist

__init__(name: str, imshow: StaticImshow | AnimatedImshow, styling_dict: dict | None = None)

Initialize a StaticColorBar object.

Parameters:
  • name (str) – Name of the static color bar

  • imshow (StaticImshow | AnimatedImshow) – Artist representing the image (either static or animated) associated with the color bar

  • styling_dict (dict, optional) – Styling dictionary, all ‘Other Parameters’ of matplotlib.figure.Figure.colorbar can be passed here, by default None

add_to_axes(axes: Axes)

Add the color bar to the specified axes.

Parameters:

axes (Axes) – Axes object to add the color bar to

set_styling_properties(**styling)

Set styling properties for the color bar.

Raises:

ValueError – For Colorbars, styling properties must be set upon instantiation via styling_dict

set_tick_labels(labels: list, orientation: str = 'vertical')

Set tick labels for the colorbar.

Parameters:
  • labels (list) – List with labels for ticks of colorbar. Should be of same length as list passed to ticks keyword in styling_dict.

  • orientation (str) – Orientation of colorbar, must be either ‘vertical’ or ‘horizontal’. Should agree with the value passed to the ‘orientation’ keyword set in ‘styling_dict’ upon instantiation.

Raises:

ValueError – If keyword is not ‘vertical’ or ‘horizontal’.

class src.matnimation.artist.static.static_hlines.StaticHlines(name: str, y_data: ndarray, x_min: float, x_max: float)

Bases: StaticArtist

__init__(name: str, y_data: ndarray, x_min: float, x_max: float)

Initialize a StaticHlines object.

Parameters:
  • name (str) – Name of the hlines object

  • y_data (np.ndarray) – 1D numpy array containing y values of hlines

  • x_min (float) – x-value of start of hlines

  • x_max (float) – x-value of end of hlines

add_to_axes(axes: Axes)

Add the hlines to the specified axes.

Parameters:

axes (Axes) – Axes object to add the hlines to

set_styling_properties(**styling)

Set styling properties for the hlines.

Raises:

ValueError – If the artist has not been added to an axes yet

Parameters:

**styling (dict) – Keyword arguments for styling the hlines

class src.matnimation.artist.static.static_imshow.StaticImshow(name: str, image_data: ndarray, extent: list, cmap='viridis', vmin: float | None = None, vmax: float | None = None)

Bases: StaticArtist

__init__(name: str, image_data: ndarray, extent: list, cmap='viridis', vmin: float | None = None, vmax: float | None = None)

Initialize a StaticImshow object.

Parameters:
  • name (str) – Name of the static imshow

  • image_data (np.ndarray) – 2D numpy array containing function values f(x,y) on grid, format like np.meshgrid

  • extent (list) – Extent over which image must be plotted in figure [xmin, xmax, ymin, ymax]

  • cmap (str, optional) – Colormap style to be used, by default ‘viridis’

  • vmin (float, optional) – Minimum value in data range covered by colormap, by default None

  • vmax (float, optional) – Maximum value in data range covered by colormap, by default None

add_to_axes(axes: Axes)

Add the imshow to the specified axes.

Parameters:

axes (Axes) – Axes object to add the imshow to

set_styling_properties(**styling)

Set styling properties for the imshow.

Raises:

ValueError – If the artist has not been added to an axes yet

Parameters:

**styling (dict) – Keyword arguments for styling the imshow

class src.matnimation.artist.static.static_line.StaticLine(name: str, x_data: ndarray, y_data: ndarray)

Bases: StaticArtist

__init__(name: str, x_data: ndarray, y_data: ndarray)

Initialize a StaticLine object.

Parameters:
  • name (str) – Name of the static line

  • x_data (np.ndarray) – 1D numpy array containing x values of the line

  • y_data (np.ndarray) – 1D numpy array containing y values of the line

class src.matnimation.artist.static.static_polygon.StaticPolygon(name: str, x_data: ndarray, y_data: ndarray)

Bases: StaticArtist

__init__(name: str, x_data: ndarray, y_data: ndarray)

Initialize a StaticPolygon object.

Parameters:
  • name (str) – Name of the static polygon

  • x_data (np.ndarray) – 1D numpy array containing x values of the polygon

  • y_data (np.ndarray) – 1D numpy array containing y values of the polygon

class src.matnimation.artist.static.static_quiver.StaticQuiver(name: str, x_data: ndarray, y_data: ndarray, Fx_data: ndarray, Fy_data: ndarray, scale: float = 1.0, scale_units: str | None = None, width: float | None = None, color='k')

Bases: StaticArtist

__init__(name: str, x_data: ndarray, y_data: ndarray, Fx_data: ndarray, Fy_data: ndarray, scale: float = 1.0, scale_units: str | None = None, width: float | None = None, color='k')

Initialize a StaticQuiver object.

Parameters:
  • name (str) – Name of the static quiver

  • x_data (np.ndarray) – 1D numpy array containing x coordinates of tails of vectors

  • y_data (np.ndarray) – 1D numpy array containing y coordinates of tails of vectors

  • Fx_data (np.ndarray) – 1D numpy array containing x-component of vectors

  • Fy_data (np.ndarray) – 1D numpy array containing y-component of vectors

  • scale (float, optional) – Sets scale of vectors, by default 1.

  • scale_units (str, optional) – Scale units of the vectors, by default None

  • width (float, optional) – Width of the arrow shaft, by default None

  • color (str or RGBA seq, optional) – Arrow color, by default ‘k’

add_to_axes(axes: Axes)

Add the quiver to the given axes.

Parameters:

axes (Axes) – Axes object to which the quiver will be added

set_styling_properties(**styling)

Set styling properties of the quiver.

Raises:

ValueError – If the artist has not been added to an axes yet

Parameters:

**styling – Styling properties to be set on the quiver

class src.matnimation.artist.static.static_scatter.StaticScatter(name: str, x_data: ndarray, y_data: ndarray)

Bases: StaticArtist

__init__(name: str, x_data: ndarray, y_data: ndarray)

Initialize a StaticScatter object.

Parameters:
  • name (str) – Name of the static scatter

  • x_data (np.ndarray) – 1D numpy array containing x values of scatters

  • y_data (np.ndarray) – 1D numpy array containing y values of scatters

class src.matnimation.artist.static.static_text.StaticText(name: str, xy_center: tuple[float])

Bases: StaticArtist

__init__(name: str, xy_center: tuple[float])

Initialize a StaticText object.

Parameters:
  • name (str) – Name of the static text

  • xy_center (tuple[float]) – Tuple containing (x, y) coordinates of text location

class src.matnimation.artist.static.static_vlines.StaticVlines(name: str, x_data: ndarray, y_min: float, y_max: float)

Bases: StaticArtist

__init__(name: str, x_data: ndarray, y_min: float, y_max: float)

Initialize a StaticVlines object.

Parameters:
  • name (str) – Name of the static vlines

  • x_data (np.ndarray) – 1D numpy array containing x values of vlines

  • y_min (float) – y-value of start of vlines

  • y_max (float) – y-value of end of vlines

add_to_axes(axes: Axes)

Add the static vlines to the specified axes.

Parameters:

axes (Axes) – The axes to which the vlines will be added

set_styling_properties(**styling)

Set styling properties of the static vlines.

Raises:

ValueError – If the artist has not been added to an axes yet

Parameters:

**styling – Keyword arguments representing styling properties