When I do a plot like this
ListPlot[
{Style[{1, 2}, Red],
Style[{2, 3}, Blue],
Style[{3, 4}, Green]}
]
under the colored points, there are duplicates with automatic Style. Indeed if you set Opacity differently than 1 you will the copy on the background
ListPlot[
{Style[{1, 2}, Red],
Style[{2, 3}, Blue, AbsolutePointSize[50], Opacity[0.5]],
Style[{3, 4}, Green]}
]
How to solve it? Thank you
lp=ListPlot[{Style[{1, 2}, Red, Opacity[.3], AbsolutePointSize[10]], Style[{2, 3}, Blue, Opacity[.3], AbsolutePointSize[10]], Style[{3, 4}, Green, Opacity[.3], AbsolutePointSize[10]]}]
shows the issue more visibly. And,plt[[1]]
clearly shows points are duplicated. Looks like a bug. $\endgroup$Style
wrapper. AsListPlot[{{{1, 2}}, {{2, 3}}, {{3, 4}, {4, 4}}, { {4, 5}, {5, 6}, {6, 7}}}][[1]]
shows if a sublist contains a single point that point is repeated. $\endgroup$Cases[Normal@plt, _Point, Infinity]
, if your plot is calledplt
, and the result is{Point[{{1., 2.}, {1., 2.}}], Point[{{2., 3.}, {2., 3.}}], Point[{{3., 4.}, {4., 4.}}], Point[{{4., 5.}, {5., 6.}, {6., 7.}}]}
. Each of the single-point lists is repeated, whereas the multiple-point lists aren't. Weird. $\endgroup$ListPlot[{{{1, 2}}, Button[{2, 3}, Print[{2, 3}]], {{3, 4}, {3, 5}}, { {4, 5}, {5, 6}, {6, 7}}}][[1]]
$\endgroup$ListPlot
? It'd be nice if we could get some input from Mathematica employees. $\endgroup$