examples package

Submodules

class examples.generic.CustomImageAnimation(n)

Bases: BaseAnimation

A subclass of BaseAnimation for creating animations with custom image data.

This class generates a random binary image and updates the animation view with the computed sine values for each frame.

__init__(n)

Initializes the CustomImageAnimation object.

Parameters:

n (int) – The size of the square image (n x n).

__initialize_view_data__(t, ax)

Initializes the view data for the animation with the initial image.

Parameters:
  • t (int) – The current frame number (not used in this method).

  • ax (matplotlib.axes.Axes) – The axes object for the animation.

Returns:

The initial view data for the animation, represented as an image.

__reset_view_data__(t, view)

Updates the view data for each frame of the animation with computed image values.

Parameters:
  • t (int) – The current frame number.

  • view – The view data from the previous frame (image object).

Returns:

The updated view data for the current frame.

__set_axes__()

Sets up the figure and axes for the animation.

Returns:

A tuple (fig, ax) with the matplotlib figure and axes objects.

_before_each_iteration(t)

Hook method called before each frame iteration.

This method is overridden but not used in this subclass.

Parameters:

t (int) – The current frame number.

_set_params(**kwargs)

Sets the parameters for the animation.

Overrides the base class method but does not add any additional parameters.

Parameters:

**kwargs – Additional keyword arguments for animation parameters.

fim(t)

Computes the image values for each frame using a custom function.

Parameters:

t (int) – The current frame number.

Returns:

Computed image values as a NumPy array.

class examples.generic.SinusoidalImageAnimation(n)

Bases: ImageAnimation

A subclass of ImageAnimation for creating animations with sinusoidal image data.

This class generates sinusoidal image data and updates the animation view with the computed sine values for each frame.

__init__(n)

Initializes the SinusoidalImageAnimation object with sinusoidal image data.

Parameters:

n (int) – The size of the square image (n x n).

_before_each_iteration(t)

Hook method called before each frame iteration.

This method is overridden but not used in this subclass.

Parameters:

t (int) – The current frame number.

_img_fct(t)

Computes the image values for each frame using sine function.

Overrides the base class method to generate sinusoidal image data.

Parameters:

t (int) – The current frame number.

Returns:

Computed image values as a NumPy array.

_set_params(**kwargs)

Sets the parameters for the animation, including the shape of the image.

Overrides the base class method to ensure the shape parameter matches the shape of the generated image.

Parameters:

**kwargs – Additional keyword arguments for animation parameters.

Returns:

The result of the superclass method call.

class examples.generic.SinusoidalParametricAnimation(n)

Bases: ParametricAnimation

A subclass of ParametricAnimation for creating sinusoidal parametric animations.

This class generates parametric data for x and y coordinates using sinusoidal functions.

__init__(n)

Initializes the SinusoidalParametricAnimation object.

Parameters:

n (int) – The number of points to generate along the x-axis.

_before_each_iteration(t)

Hook method called before each frame iteration.

This method is overridden but not used in this subclass.

Parameters:

t (int) – The current frame number.

_fx(t)

Computes the x-coordinate values for each frame using a linear space.

Parameters:

t (int) – The current frame number.

Returns:

Computed x-coordinate values as a NumPy array.

_fy(t)

Computes the y-coordinate values for each frame using a sine function.

Parameters:

t (int) – The current frame number.

Returns:

Computed y-coordinate values as a NumPy array.

class examples.generic.ThreeDsinusoidalParametricAnimation(n)

Bases: ThreeDimensionalParametricAnimation

A subclass of ThreeDimensionalParametricAnimation for creating 3D sinusoidal parametric animations.

This class generates parametric data for x, y, and z coordinates using sinusoidal functions.

__init__(n)

Initializes the ThreeDsinusoidalParametricAnimation object.

Parameters:

n (int) – The number of points to generate along the x-axis.

_before_each_iteration(t)

Hook method called before each frame iteration.

This method is overridden to generate new x-values for each frame.

Parameters:

t (int) – The current frame number.

_fx(t)

Computes the x-coordinate values for each frame using a sinusoidal function.

Parameters:

t (int) – The current frame number.

Returns:

Computed x-coordinate values as a NumPy array.

_fy(t)

Computes the y-coordinate values for each frame using a sinusoidal function.

Parameters:

t (int) – The current frame number.

Returns:

Computed y-coordinate values as a NumPy array.

_fz(t)

Computes the z-coordinate values for each frame using a hyperbolic tangent function.

examples.generic.test_save_animations()
examples.generic.test_show_animations()
examples.lissajou_examples.showcase_fixed_ratio_lissajou()
examples.lissajou_examples.showcase_generic_lissajou()
examples.lissajou_examples.showcase_lissajou_circle()
examples.lissajou_examples.showcase_lissajou_ellipse()
examples.lissajou_examples.showcase_sinusoidal_amplitude_lissajou()
examples.lissajou_examples.showcase_varying_amplitude_lissajou()

Module contents