viz3dvideo.scatter package

Submodules

viz3dvideo.scatter.path module

viz3dvideo.scatter.path.animate_path(X, Y, Z, W, camera_points, output_path='animate_path.mp4', pixel_size=(1920, 1080), dpi=200, colormap='viridis', frames=360, fps=30, cb_enable=False, cb_title='W', s=40)

Creates and saves a 3D scatter animation following a camera path defined by camera_points.

Parameters:
  • X (array-like) – 1D arrays of point coordinates.

  • Y (array-like) – 1D arrays of point coordinates.

  • Z (array-like) – 1D arrays of point coordinates.

  • W (array-like) – 1D array of values used to color the points.

  • camera_points (list of tuple) – List of (elev, azim) tuples defining the camera path.

  • frames (int, optional) – Total number of frames. Default is 360.

  • pixel_size (tuple, optional) – Figure size in pixels (width, height). Default is (1920, 1080).

  • dpi (int, optional) – Figure resolution in dots per inch. Default is 100.

  • colormap (str, optional) – Matplotlib colormap for coloring. Default is ‘viridis’.

  • output_path (str, optional) – Output file name. Default is ‘animate_scatter_path.mp4’.

  • fps (int, optional) – Frames per second for the video. Default is 30.

  • cb_enable (bool, optional) – Enable colorbar. Default is False.

  • cb_title (str, optional) – Colorbar title. Default is “W”.

  • s (int, optional) – Size of scatter points. Default is 40.

Returns:

None

viz3dvideo.scatter.rotate module

viz3dvideo.scatter.rotate.animate_rotate(X, Y, Z, W, output_path='animate_rotate.mp4', pixel_size=(1920, 1080), dpi=200, colormap='viridis', frames=360, fps=30, cb_enable=False, cb_title='W', elev=30, interval=0.5, s=40)

Creates and saves a 3D rotating scatter plot animation.

Parameters:
  • X (array-like) – Coordinates X of the points (1D arrays).

  • Y (array-like) – Coordinates Y of the points (1D arrays).

  • Z (array-like) – Coordinates Z of the points (1D arrays).

  • W (array-like) – Values used to color the points.

  • output_path (str, optional) – Output video file. Default ‘animate_rotate.mp4’.

  • pixel_size (tuple, optional) – Size of video in pixels. Default (1920, 1080).

  • dpi (int, optional) – Dots per inch. Default 100.

  • colormap (str, optional) – Matplotlib colormap for coloring. Default ‘viridis’.

  • elev (float, optional) – Initial elevation angle. Default 30.

  • frames (int, optional) – Number of frames. Default 360.

  • interval (float, optional) – Angle interval between frames in degrees. Default is 1.0.

  • fps (int, optional) – Frames per second. Default 30.

  • s (int, optional) – Scatter point size. Default 40.

  • cb_enable (bool, optional) – Enable colorbar. Default False.

  • cb_title (str, optional) – Title of colorbar. Default “W”.

Returns:

None

Module contents

viz3dvideo.scatter

Subpackage for 3D scatter visualizations.

This subpackage provides functions to create animated 3D scatter plots using Matplotlib. Animations can either rotate around the data or follow a custom camera path.

Available functions:

  • animate_rotate(X, Y, Z, W, …) : Create a rotating 3D scatter plot animation.

  • animate_path(X, Y, Z, W, camera_points, …) : Animate a scatter plot following a camera path.

Example usage:

from viz3dvideo.scatter import animate_rotate

animate_rotate(X, Y, Z, W, frames=360, fps=30)