ShowLegend[graphics,legend1,legend2,…]
places the legend1, legend2, … in the given graphic graphics.
ShowLegend
ShowLegend[graphics,legend1,legend2,…]
places the legend1, legend2, … in the given graphic graphics.
Details and Options
- To use ShowLegend, you first need to load the Plot Legends Package using Needs["PlotLegends`"].
- Each legendi is in the same format as a call to Legend.
- The graphic graphics is placed in a rectangle whose center is at
, and whose boundaries are
. These coordinates must be used to place the legends. - The aspect ratio of graphics is unchanged.
Examples
Basic Examples (1)
Needs["PlotLegends`"]ShowLegend[DensityPlot[Sin[x y], {x, 0, π}, {y, 0, π}, Mesh -> False, PlotPoints -> 30], {ColorData["LakeColors"][1 - #1]&, 10, " 1", "-1", LegendPosition -> {1.1, -.4}}]ShowLegend[Plot3D[Sin[x y], {x, 0, π}, {y, 0, π}, ColorFunction -> "Rainbow"], {ColorData["Rainbow"][1 - #1]&, 10, " 1", "-1", LegendPosition -> {1.1, -.4}}]Plot with a legend for the filling styles:
ShowLegend[Plot[Sin[x], {x, 0, 10}, Filling -> Axis, FillingStyle -> {Red, Blue}], {{{Graphics[{Blue, Disk[{0, 0}, 1]}], Sin[x] > 0}, {Graphics[{Red, Disk[{0, 0}, 1]}], Sin[x] < 0}}}]See Also
Tech Notes
Related Guides
Text
Wolfram Research (2007), ShowLegend, Wolfram Language function, https://reference.wolfram.com/language/PlotLegends/ref/ShowLegend.html.
CMS
Wolfram Language. 2007. "ShowLegend." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/PlotLegends/ref/ShowLegend.html.
APA
Wolfram Language. (2007). ShowLegend. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/PlotLegends/ref/ShowLegend.html
BibTeX
@misc{reference.wolfram_2026_showlegend, author="Wolfram Research", title="{ShowLegend}", year="2007", howpublished="\url{https://reference.wolfram.com/language/PlotLegends/ref/ShowLegend.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_showlegend, organization={Wolfram Research}, title={ShowLegend}, year={2007}, url={https://reference.wolfram.com/language/PlotLegends/ref/ShowLegend.html}, note=[Accessed: 15-June-2026]}