add_line#

Subplot.add_line(data, thickness=2.0, colors='w', uniform_color=False, alpha=1.0, cmap=None, cmap_transform=None, isolated_buffer=True, size_space='screen', **kwargs)#

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

  • uniform_color (bool, default False) – if True, uses a uniform buffer for the line color, basically saves GPU VRAM when the entire line has a single color

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

  • 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/

  • 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

Return type:

LineGraphic

Examples#

Specify IDs with subplot names

Specify IDs with subplot names

Sync subplots

Sync subplots

LinearRegionSelectors with LineCollection

LinearRegionSelectors with LineCollection