PlotLegends

PlotLegends
is an option for plot functions that specifies what legends to use.

DetailsDetails

  • Typical settings for PlotLegends include:
  • Noneadd no legend
    Automaticuse automatic legending
    "Expressions"use formulas as legend labels
    {lbl1,lbl2,}use for the i^(th) input
    expruse expr as legend
    Placed[lspec,]specify placement of legend
  • The following legend constructors can be used to form commonly occurring legends: SwatchLegend, LineLegend, PointLegend, and BarLegend.

ExamplesExamplesopen allclose all

Basic Examples  (4)Basic Examples  (4)

Use editable placeholders as the legend for a plot:

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

Use the expressions being plotted as the legend:

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

Specify the text for a legend:

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

Place the legend above the plot:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2012
(9.0)
Translate this page: