fastplotlib.LineCollection#

class LineCollection(data, thickness=2.0, colors='w', uniform_colors=False, alpha=1.0, cmap=None, cmap_transform=None, name=None, names=None, metadata=None, metadatas=None, isolated_buffer=True, kwargs_lines=None, **kwargs)[source]#

Create a collection of LineGraphic

Parameters:
  • data (list of array-like) –

    List or array-like of multiple line data to plot

    if list each item in the list must be a 1D, 2D, or 3D numpy array
    if array-like, must be of shape [n_lines, n_points_line, y | xy | xyz]

  • thickness (float or Iterable of float, default 2.0) –

    if float, single thickness will be used for all lines
    if list of float, each value will apply to the individual lines

  • colors (str, RGBA array, Iterable of RGBA array, or Iterable of str, default "w") –

    if single str such as “w”, “r”, “b”, etc, represents a single color for all lines
    if single RGBA array (tuple or list of size 4), represents a single color for all lines
    if list of str, represents color for each individual line, example [“w”, “b”, “r”,…]
    if RGBA array of shape [data_size, 4], represents a single RGBA array for each line

  • alpha (float, optional) – alpha value for colors, if colors is a str

  • cmap (Iterable of str or str, optional) –

    if str, single cmap will be used for all lines
    if list of str, each cmap will apply to the individual lines

    Note

    cmap overrides any arguments passed to colors

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

  • name (str, optional) – name of the line collection as a whole

  • names (list[str], optional) – names of the individual lines in the collection, len(names) must equal len(data)

  • metadata (Any) – meatadata associated with the collection as a whole

  • metadatas (Iterable or array) – metadata for each individual line associated with this collection, this is for the user to manage. len(metadata) must be same as len(data)

  • kwargs_lines (list[dict], optional) – list of kwargs passed to the individual lines, len(kwargs_lines) must equal len(data)

  • kwargs_collection – kwargs for the collection, passed to GraphicCollection

Examples#

Rectangle Selectors

Rectangle Selectors

Lorenz System Animation

Lorenz System Animation