create_legend_item#

InfLineGraphic.create_legend_item(label=None, dash_pattern_labels=None, cmap_transform_labels=None)#

Create the LineLegendItem of this line, add it to a legend with Legend.add().

The item follows the line: when its colors, colormap, thickness or dash pattern change the item changes with them. Per-vertex colors cannot be represented in a legend.

Parameters:
  • label (str, optional) – label of the line in the legend, its name is used if not provided

  • dash_pattern_labels (dict, optional) – {dash_pattern: label}, the label to use for the line’s dash pattern

  • cmap_transform_labels (dict, optional) – {cmap_transform value: label}, the label of each value of a qualitative colormap. A quantitative colormap is shown as a colorbar instead and needs no labels.

Return type:

LineLegendItem

Examples#

ImGUI Legend

ImGUI Legend