PointLegend

PointLegend[{col1, ...}, {lbl1, ...}]
generates a legend that associates points of colors with labels .

PointLegend[{col1, ...}, Automatic]
generates a legend with placeholder labels for the colors .

PointLegend[{lbl1, ...}]
represents a legend with inherited colors within visualization functions.

Details and OptionsDetails and Options

  • PointLegend uses a point with color to identify label with elements in a visualization or other legended item.
  • Legended[expr, PointLegend[...]] can be used to apply a legend to an arbitrary expression expr.
  • The following options can be given:
  • JoinedFalsewhether to draw a joined line with the points
    LabelStyleAutomaticstyle to use for labels
    LegendFunctionIdentitywrapper for the overall legend
    LegendLabelNoneoverall label for legend
    LegendLayoutAutomaticlegend layout to use
    LegendMarginsAutomaticspace between legend content and boundaries
    LegendMarkersNoneshape of each point
    LegendMarkerSizeAutomaticsize of the shape
  • PointLegend is displayed in StandardForm as a table. In InputForm, it is displayed as an explicit list of colors and labels.
  • In PointLegend, LegendLayout can have the following forms:
  • Automaticautomatically determine 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 to generate the legend.
  • LegendFunction is applied to the legend, including any overall label and margins.

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

A list of styles and labels:

In[1]:=
Click for copyable input
Out[1]=

Use placeholder labels:

In[1]:=
Click for copyable input
Out[1]=

PointLegend is used to automatically create legends for ListPlot:

In[1]:=
Click for copyable input
Out[1]=

Customize the appearance of the legend:

In[2]:=
Click for copyable input
Out[2]=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »