fastplotlib.ScatterGraphic#

class ScatterGraphic(data, colors='w', uniform_color=False, alpha=1.0, cmap=None, cmap_transform=None, isolated_buffer=True, sizes=1, uniform_size=False, size_space='screen', **kwargs)[source]#

Create a Scatter Graphic, 2d or 3d

Parameters:
  • data (array-like) – Scatter data to plot, Can provide 2D, or a 3D data. 2D data must be of shape [n_points, 2]. 3D data must be of shape [n_points, 3]

  • colors (str, array, tuple, list, Sequence, default "w") – specify colors as a single human-readable string, a single RGBA array, or a Sequence (array, tuple, or list) of strings or RGBA arrays

  • uniform_color (bool, default False) – if True, uses a uniform buffer for the scatter point colors. Useful if you need to save GPU VRAM when all points have the same color.

  • alpha (float, optional, default 1.0) – alpha value for the colors

  • cmap (str, optional) – apply a colormap to the scatter instead of assigning colors manually, this overrides any argument passed to “colors”. For supported colormaps see the cmap library catalogue: https://cmap-docs.readthedocs.io/en/stable/catalog/

  • cmap_transform (1D array-like or list of numerical values, optional) – if provided, these values are used to map the colors from the cmap

  • isolated_buffer (bool, default True) – whether the buffers should be isolated from the user input array. Generally always True, False is for rare advanced use if you have large arrays.

  • sizes (float or iterable of float, optional, default 1.0) – sizes of the scatter points

  • uniform_size (bool, default False) – if True, uses a uniform buffer for the scatter point sizes. Useful if you need to save GPU VRAM when all points have the same size.

  • size_space (str, default "screen") – coordinate space in which the size is expressed (“screen”, “world”, “model”)

  • kwargs – passed to Graphic

Examples#

Drag points

Drag points

Scatter click

Scatter click

Scatter hover

Scatter hover

Scatter data explore scalers

Scatter data explore scalers

K-Means Clustering of MNIST Dataset

K-Means Clustering of MNIST Dataset

Scatter Animation Colors

Scatter Animation Colors

Simple 3D Line Animation

Simple 3D Line Animation

Lorenz System Animation

Lorenz System Animation

Scatter Animation Data

Scatter Animation Data

Tooltips

Tooltips

Tooltips Customization

Tooltips Customization

Iris Scatter Colormap

Iris Scatter Colormap

Scatter Plot Color Slicing

Scatter Plot Color Slicing

Iris Scatter Plot Color Slicing

Iris Scatter Plot Color Slicing

Scatter Plot Data Slicing

Scatter Plot Data Slicing

Iris Scatter Plot Data Slicing

Iris Scatter Plot Data Slicing

Spinning spiral scatter

Spinning spiral scatter

Moving TextGraphic label

Moving TextGraphic label