Wolfram Language

Visualization: Labels, Scales, Exclusions

Auto-labeling Data

ListPlot and related functions support LabelingFunction now.

show complete Wolfram Language input
In[1]:=
Click for copyable input
SeedRandom[3]; data = Accumulate@Table[RandomInteger[5], 12];

When proper metadata is present, LabelingFunction automatically uses it as labels.

In[2]:=
Click for copyable input
months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
In[3]:=
Click for copyable input
DateListPlot[data -> months, {2000, 1}, PlotMarkers -> {Automatic, 13}, ImageSize -> 550, Frame -> {{True, False}, {False, False}}, PlotTheme -> {"LargeLabels", "Business"}]
Out[3]=

Use Callout in LabelingFunction.

In[4]:=
Click for copyable input
DateListPlot[data -> months, {2000, 1}, LabelingFunction -> Callout[ Automatic, Automatic], PlotMarkers -> {Automatic, 13}, ImageSize -> 550, Frame -> {{True, False}, {False, False}}, PlotTheme -> {"LargeLabels", "Business"}]
Out[4]=

Place the labels centered where the data is.

In[5]:=
Click for copyable input
opts = {PlotTheme -> {"LargeLabels", "Marketing"}, ImageSize -> 550, Frame -> {{True, False}, {False, False}}, PlotRangePadding -> Scaled[.05], Frame -> {{True, False}, {False, False}}};
In[6]:=
Click for copyable input
SeedRandom[4]; DateListStepPlot[ RandomReal[{0, 0.3}, 12] -> months, {2000, 1}, LabelingFunction -> Center, opts]
Out[6]=

Related Examples

de es fr ja ko pt-br ru