PlotLegend
Details and Options
- To use PlotLegend, you first need to load the Plot Legends Package using Needs["PlotLegends`"].
- PlotLegend->{text1,text2,…} assigns text to each line in the same fashion as PlotStyle.
- PlotLegend also enables Plot and related functions to accept options for Legend, which will modify the legend produced.
Examples
Basic Examples (1)
Needs["PlotLegends`"]Add a legend to a plot to identify curves:
Plot[{Sin[x], Cos[x]}, {x, 0, 2Pi}, PlotLegend -> {"sine", "cosine"}]ListPlot[Table[{x, f[x]}, {f, {Sin, Cos, Log}}, {x, 0, 10, 0.5}], PlotLegend -> {"Sine", "Cosine", "Log"}, LegendPosition -> {1.1, -0.4}, Joined -> {True, True, False}, PlotMarkers -> Automatic]Tech Notes
Related Guides
Text
Wolfram Research (2007), PlotLegend, Wolfram Language function, https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html.
CMS
Wolfram Language. 2007. "PlotLegend." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html.
APA
Wolfram Language. (2007). PlotLegend. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html
BibTeX
@misc{reference.wolfram_2026_plotlegend, author="Wolfram Research", title="{PlotLegend}", year="2007", howpublished="\url{https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_plotlegend, organization={Wolfram Research}, title={PlotLegend}, year={2007}, url={https://reference.wolfram.com/language/PlotLegends/ref/PlotLegend.html}, note=[Accessed: 15-June-2026]}