fastplotlib.LineStackΒΆ

class LineStack(data, z_offset=None, thickness=2.0, colors='w', alpha=1.0, cmap=None, cmap_values=None, name=None, metadata=None, separation=10.0, separation_axis='y', *args, **kwargs)[source]ΒΆ

Create a stack of LineGraphic that are separated along the β€œx” or β€œy” axis.

Parameters:
  • data (list of array-like or array) – List of line data to plot, each element must be a 1D, 2D, or 3D numpy array if elements are 2D, interpreted as [y_vals, n_lines]

  • z_offset (Iterable of float or float, optional) –

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

  • 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

  • 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_values (1D array-like or Iterable of numerical values, optional) – if provided, these values are used to map the colors from the cmap

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

  • separation (float, default 10) – space in between each line graphic in the stack

  • separation_axis (str, default "y") – axis in which the line graphics in the stack should be separated

  • name (str, optional) – name of the line stack

  • kwargs – passed to LineCollection

Features

Collections support the same features as the underlying graphic. You just have to slice the selection.

See LineGraphic details on the features.