ChartLegends

ChartLegends

is an option for charting functions that specifies what legends should be used for chart elements.

Details

  • ChartLegends->{leg1,leg2,} uses legi as a legend label for the i^(th) element in each dataset.
  • The legi can be any strings, graphics, or other static or dynamic expressions.
  • Any legend labels that are specified are collected in a legend that is displayed as part of the chart.
  • The overall form and appearance of legends is specified by settings for LegendAppearance.
  • None indicates no legend label. If there are more elements in a dataset than lbli specified, the subsequent legi are taken to be None.
  • If explicit legending is specified in a dataset using Legended, it is added to legends specified through ChartLegends.
  • Positioning of legends and other effects can be specified using Placed.
  • ChartLegendsPlaced[leg,pos] places the legend leg at the position specified by pos.
  • Possible forms for pos are:
  • Above,Below,Before,Afterpositions outside the bounding box for expr
    {h,v}horizontal h and vertical positions v
    {{ex,ey},{lx,ly}}scaled position {lx,ly} in the legend at scaled position {ex,ey} in expr
  • Possible horizontal positions include Before, Left, Center, Right and After.
  • Possible vertical positions include Below, Bottom, Center, Top and Above.
  • ChartLegends->{spec1,spec2,} uses the successive speci to specify legend labels for successive dimensions in nested lists of datasets.

Examples

Basic Examples  (4)

Generate a legend based on chart style:

Generate a legend for datasets:

Unused legend labels are dropped:

Place the legend below the chart:

Place the legend inside the chart:

Wolfram Research (2008), ChartLegends, Wolfram Language function, https://reference.wolfram.com/language/ref/ChartLegends.html.

Text

Wolfram Research (2008), ChartLegends, Wolfram Language function, https://reference.wolfram.com/language/ref/ChartLegends.html.

CMS

Wolfram Language. 2008. "ChartLegends." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ChartLegends.html.

APA

Wolfram Language. (2008). ChartLegends. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChartLegends.html

BibTeX

@misc{reference.wolfram_2024_chartlegends, author="Wolfram Research", title="{ChartLegends}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/ChartLegends.html}", note=[Accessed: 15-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_chartlegends, organization={Wolfram Research}, title={ChartLegends}, year={2008}, url={https://reference.wolfram.com/language/ref/ChartLegends.html}, note=[Accessed: 15-October-2024 ]}