Here is an example of a ListLinePlot
. How can get the text of the PlotLabels
option to be the same as the colors automatically assigned to the curves by the PlotTheme
option?
num = 10;
data1 = N@Sin@Range[num];
data2 = N@Cos@Range[num];
mark = ToString @@@ {Last@data1, Last@data2};
ListLinePlot[{data1, data2},
Frame -> True,
GridLines -> Automatic,
GridLinesStyle -> Directive[Gray, Dotted],
PlotRange -> All,
PlotTheme -> "Web",
PlotLegends -> Placed[SwatchLegend[mark], {Top, Left}],
PlotLabels -> mark,
InterpolationOrder -> 2,
ImageSize -> Large
]
Although the user can do this mannually like this here,
{Style[text1, color1], Style[text2, color2]}
when data set count increases, it becomes increasingly more difficult to give the colors values that the PlotTheme option assigned.