Автомаркирующие данные
ListPlot и относящиеся к ней функции теперь поддерживают LabelingFunction.
код на языке Wolfram Language целиком
При наличии соответствующих метаданных LabelingFunction автоматически использует свои метки.
In[2]:=
![Click for copyable input](assets.ru/auto-labeling-data/In_30.png)
months = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec"};
In[3]:=
![Click for copyable input](assets.ru/auto-labeling-data/In_31.png)
DateListPlot[data -> months, {2000, 1},
PlotMarkers -> {Automatic, 13}, ImageSize -> 550,
Frame -> {{True, False}, {False, False}},
PlotTheme -> {"LargeLabels", "Business"}]
Out[3]=
![](assets.ru/auto-labeling-data/O_28.png)
Используйте Callout в LabelingFunction.
In[4]:=
![Click for copyable input](assets.ru/auto-labeling-data/In_32.png)
DateListPlot[data -> months, {2000, 1},
LabelingFunction -> Callout[ Automatic, Automatic],
PlotMarkers -> {Automatic, 13}, ImageSize -> 550,
Frame -> {{True, False}, {False, False}},
PlotTheme -> {"LargeLabels", "Business"}]
Out[4]=
![](assets.ru/auto-labeling-data/O_29.png)
Разместите метки с центром на данных.
In[5]:=
![Click for copyable input](assets.ru/auto-labeling-data/In_33.png)
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](assets.ru/auto-labeling-data/In_34.png)
SeedRandom[4]; DateListStepPlot[
RandomReal[{0, 0.3}, 12] -> months, {2000, 1},
LabelingFunction -> Center, opts]
Out[6]=
![](assets.ru/auto-labeling-data/O_30.png)