LineLegend
LineLegend[{col1,…},{lbl1,…}]
generates a legend that associates color coli with label lbli.
LineLegend[{col1,…},Automatic]
generates a legend with placeholder labels for the colors coli.
LineLegend[{lbl1,…}]
represents a legend with inherited colors within visualization functions.
Details and Options
- LineLegend uses a line with style coli through a marker to identify label lbli with curves and markers in the visualization or other legended item.
- Legended[expr,LineLegend[…]] can be used to apply a legend to an arbitrary expression expr.
- The following options can be given:
-
Joined True whether to draw shapes LabelStyle Automatic style to use for labels LegendFunction Identity wrapper for the overall legend LegendLabel None overall label for legend LegendLayout Automatic legend layout to use LegendMargins Automatic space between legend content and boundaries LegendMarkers None markers to use to indicate each element LegendMarkerSize Automatic size of the shape - LineLegend is displayed in StandardForm as a table. In InputForm, it is displayed as an explicit list of colors and labels.
- In LineLegend, LegendLayout can have the following forms:
-
Automatic automatically determine layout "Row" display legend in a horizontal row "Column" display legend in a vertical column "ReversedRow" display reversed legend in a horizontal row "ReversedColumn" display reversed legend in a vertical column f apply f to construct the legend - The layout specification f is applied to the table of values {{col1,lbl1},…} to generate the legend.
- LegendFunction is applied to the legend, including any overall label and margins.
Examples
open allclose allScope (15)
Data (9)
Use Directive to combine directives in a style:
LineLegend uses the shorter list of styles and labels:
Use Placeholder labels:
LineLegend remains unevaluated in other cases:
LineLegend normally displays in tabular form:
InputForm shows a textual form:
Presentation (6)
LineLegend line wraps automatically:
LineLegend automatically picks up styles when used in plots:
LineLegend automatically picks up PlotMarkers:
Change the default look of LineLegend and the position:
Use Legended to legend Graphics with LineLegend:
Options (27)
Joined (3)
LabelStyle (3)
All labels have the same default style:
LabelStyle applies to LegendLabel:
LegendFunction (4)
LegendLabel (5)
Add an overall label to the legend:
The label from LegendLabel is included in the argument to LegendFunction:
Construct a LegendFunction using Labeled that has a label outside:
Use LabelStyle to style the legend label:
Use Placed to change the legend label position:
Use the third argument in Placed to rotate the legend label:
LegendLayout (4)
LegendMargins (3)
Leave no space between the legend content and any boundaries from LegendFunction:
LegendMarkers (3)
By default, no markers are drawn:
LegendMarkers->Automatic matches the markers used by the plot:
Text
Wolfram Research (2012), LineLegend, Wolfram Language function, https://reference.wolfram.com/language/ref/LineLegend.html.
CMS
Wolfram Language. 2012. "LineLegend." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LineLegend.html.
APA
Wolfram Language. (2012). LineLegend. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LineLegend.html