Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Visualization and Graphics > Charting and Information Visualization > Chart Labeling, Legending & Annotation >
Mathematica > Visualization and Graphics > Data Visualization > Charting and Information Visualization > Chart Labeling, Legending & Annotation >

ChartLegends

ChartLegends
is an option for charting functions that specifies what legends should be used for chart elements.
  • 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 labi 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.
  • ChartLegends->Placed[{leg1, leg2, ...}, pos] places the legend containing the legi at the position specified by pos.
  • ChartLegends->{spec1, spec2, ...} uses the successive speci to specify legend labels for successive dimensions in nested lists of datasets.
Generate a legend based on chart style:
Generate a legend for datasets:
Unused legend labels are dropped:
Generate a legend based on chart style:
In[1]:=
Click for copyable input
Out[1]=
 
Generate a legend for datasets:
In[1]:=
Click for copyable input
Out[1]=
 
Unused legend labels are dropped:
In[1]:=
Click for copyable input
Out[1]=
New in 7
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team