fastplotlib.LineGraphic#

class LineGraphic(data, thickness=2.0, colors='w', cmap=None, cmap_transform=None, color_mode='auto', size_space='screen', **kwargs)[source]#

Create a line Graphic, 2d or 3d

Parameters:
  • data (array-like) – Line data to plot. Can provide 1D, 2D, or a 3D data. | If passing a 1D array, it is used to set the y-values and the x-values are generated as an integer range from [0, data.size] | 2D data must be of shape [n_points, 2]. 3D data must be of shape [n_points, 3]

  • thickness (float, optional, default 2.0) – thickness of the line

  • colors (str, array, or iterable, 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

  • cmap (str, optional) – Apply a colormap to the line 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/

  • color_mode (one of "auto", "uniform", "vertex", default "auto") – “uniform” restricts to a single color for all line datapoints. “vertex” allows independent colors per vertex. For most cases you can keep it as “auto” and the color_mode is determineed automatically based on the argument passed to colors. if colors represents a single color, then the mode is set to “uniform”. If colors represents a unique color per-datapoint, or if a cmap is provided, then color_mode is set to “vertex”. You can switch between “uniform” and “vertex” color_mode after creating the graphic.

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

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

  • **kwargs – passed to Graphic

Examples#

Drag points

Drag points

Events line data thickness

Events line data thickness

Sine and Cosine functions

Sine and Cosine functions

Simple Line Plot

Simple Line Plot

Line Plot Colormap

Line Plot Colormap

Lines more colormapping

Lines more colormapping

Line Plot Color Slicing

Line Plot Color Slicing

Line Plot Data Slicing

Line Plot Data Slicing

Line collection slicing

Line collection slicing

Simple 3D Line Animation

Simple 3D Line Animation

Simple Line Animation

Simple Line Animation

Lorenz System Animation

Lorenz System Animation

Change number of points in lines and scatters

Change number of points in lines and scatters

LinearRegionSelectors

LinearRegionSelectors

Linear Selectors

Linear Selectors

Linear Selectors Image

Linear Selectors Image

Unit circle

Unit circle

Rotate line

Rotate line

Scale line

Scale line

Translate line

Translate line

Translate and scale line

Translate and scale line

Translate scale and rotate line

Translate scale and rotate line

Moving TextGraphic label

Moving TextGraphic label