generates a legend that associates color coli with label lbli.


generates a legend with placeholder labels for the colors coli.


represents a legend with inherited colors within visualization functions.

Details and Options

  • LineLegend uses a line with style coli through a marker to identify label lbli with curves and markers in the visualization or other legended item.
  • Legended[expr,LineLegend[]] can be used to apply a legend to an arbitrary expression expr.
  • The following options can be given:
  • JoinedTruewhether to draw shapes
    LabelStyleAutomaticstyle to use for labels
    LegendFunctionIdentitywrapper for the overall legend
    LegendLabelNoneoverall label for legend
    LegendLayoutAutomaticlegend layout to use
    LegendMarginsAutomaticspace between legend content and boundaries
    LegendMarkersNonemarkers to use to indicate each element
    LegendMarkerSizeAutomaticsize of the shape
  • LineLegend is displayed in StandardForm as a table. In InputForm, it is displayed as an explicit list of colors and labels.
  • In LineLegend, LegendLayout can have the following forms:
  • Automaticautomatically determined layout
    "Row"display legend in a horizontal row
    "Column"display legend in a vertical column
    "ReversedRow"display reversed legend in a horizontal row
    "ReversedColumn"display reversed legend in a vertical column
    fapply f to construct the legend
  • The layout specification f is applied to the table of values {{col1,lbl1},} to generate the legend.
  • LegendFunction is applied to the legend, including any overall label and margins.


open all close all

Basic Examples  (1)

A list of styles and labels:

Click for copyable input

Use default labels:

Click for copyable input

Used in plots:

Click for copyable input

Scope  (15)

Options  (27)

Introduced in 2012