add_line_collectionΒΆ

Subplot.add_line_collection(data, z_offset=None, thickness=2.0, colors='w', alpha=1.0, cmap=None, cmap_values=None, name=None, metadata=None, *args, **kwargs)ΒΆ

Create a collection of LineGraphic

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

  • 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_values (1D array-like or Iterable 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

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

  • args – passed to GraphicCollection

  • kwargs – passed to GraphicCollection

Return type:

LineCollection

Features

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

See LineGraphic details on the features.