Bug introduced in 11.0 and fixed in 11.1
Given a ListPlot
like this, for example:
data = RandomReal[{-1, 1}, {10, 2}];
labels = Flatten@RandomInteger[{1, 2}, {10, 1}]
ListPlot[data -> labels]
How can I style the labels with a specific color? It kind of freaks me out that it is not possible to just use Style
on the labels variable like this:
data = RandomReal[{-1, 1}, {10, 2}];
labels = Style[Flatten@RandomInteger[{1, 2}, {10, 1}], Red]
ListPlot[data -> labels]
Then, no labels are shown at all.
Also, how can I increase the distance between points and corresponding labels?
I'm using mathematica: 11.0.1.0
labels = Style[#, Red] & /@ Flatten@RandomInteger[{1, 2}, {10, 1}];
$\endgroup$labels = Style[#, Red] & /@ Flatten@RandomInteger[{1, 2}, {10, 1}]; ListPlot[ data -> labels // Thread]
? $\endgroup$