LegendBackground
is an option for Legend that specifies the style of background to use with a legend.
LegendBackground
LegendBackground
is an option for Legend that specifies the style of background to use with a legend.
Details and Options
- To use LegendBackground, you first need to load the Plot Legends Package using Needs["PlotLegends`"].
- LegendBackground sets ShadowForeground and will override any value passed to ShadowForeground.
- LegendBackground->style specifies that the legend background is created with the specified graphics directive or list of directives.
Examples
Basic Examples (1)
Needs["PlotLegends`"]Use a white background for the legend:
Plot[{Sin[x], Cos[x]}, {x, 0, 2Pi}, PlotLegend -> {"sine", "cosine"}, LegendBackground -> White]Use a yellow background for the legend:
Plot[{Sin[x], Cos[x]}, {x, 0, 2Pi}, PlotLegend -> {"sine", "cosine"}, LegendBackground -> Yellow]See Also
Tech Notes
Related Guides
Text
Wolfram Research (2016), LegendBackground, Wolfram Language function, https://reference.wolfram.com/language/PlotLegends/ref/LegendBackground.html.
CMS
Wolfram Language. 2016. "LegendBackground." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/PlotLegends/ref/LegendBackground.html.
APA
Wolfram Language. (2016). LegendBackground. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/PlotLegends/ref/LegendBackground.html
BibTeX
@misc{reference.wolfram_2026_legendbackground, author="Wolfram Research", title="{LegendBackground}", year="2016", howpublished="\url{https://reference.wolfram.com/language/PlotLegends/ref/LegendBackground.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_legendbackground, organization={Wolfram Research}, title={LegendBackground}, year={2016}, url={https://reference.wolfram.com/language/PlotLegends/ref/LegendBackground.html}, note=[Accessed: 15-June-2026]}