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

- Typical settings for PlotLegends include:
-
None add no legend Automatic use automatic legending "Expressions" use formulas as legend labels {lbl1,lbl2,…} use lbli for the i input
expr use 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.
Examples
open allclose allBasic Examples (4)
Scope (5)
Legend Content (2)
Use LineLegend to construct a legend:
Use SwatchLegend to construct a legend:
BarLegend is used in ContourPlot and DensityPlot:
Use SwatchLegend to construct a legend:
Legend Placement (3)
Use Placed to change legend placement:
Use named horizontal and vertical positions to place a legend:
Use scaled coordinates associated with plot range to place a legend:
For fine-control legend placement, specify the position where a legend should be placed:
Possible Issues (1)
Control variables in Manipulate are shown in legend with full context due to the HoldForm:
Use With to show the variable value:
Text
Wolfram Research (2012), PlotLegends, Wolfram Language function, https://reference.wolfram.com/language/ref/PlotLegends.html.
CMS
Wolfram Language. 2012. "PlotLegends." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PlotLegends.html.
APA
Wolfram Language. (2012). PlotLegends. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PlotLegends.html