I have a set of data in an array; each element of the overall array is a list of the form $\{x, y, c\}$, where $c$ is a number representing a property of the data point $\{x, y\}$. I can plot these data pretty straightforwardly on a ListPlot
:
RandomSeed[719];
data = RandomReal[{0, 1}, {100, 3}];
wrappeddata1 = Style[{#[[1]], #[[2]]}, ColorData["DarkRainbow"][#[[3]]]] & /@ data;
ListPlot[wrappeddata1, AspectRatio -> 1, ImageSize -> Large]
However, I need to differentiate between the data in a particular region of the plot (given by an inequality $f(x,y) < c$) and the data outside of this region. I can change the color of the data points easily enough; for example, I can color all points with $x^2 + y^2 < 1/4$ black:
wrappeddata2 = Style[{#[[1]], #[[2]]}, If[#[[1]]^2 + #[[2]]^2 < 1/4, Black,
ColorData["DarkRainbow"][#[[3]]]]] & /@ data;
ListPlot[wrappeddata2, AspectRatio -> 1, ImageSize -> Large]
What I would really like to do, though, is change the markers' shape according to their location, instead of changing their color. In other words, I'd like to turn every red dot into a red triangle (say) inside a given region, and leave all the other markers as is. If I split the data into two lists, though, I can't change the marker without losing the coloring; the command
ListPlot[GatherBy[wrappeddata1, #[[1, 1]]^2 + #[[1, 2]]^2 > 1/4 &],
AspectRatio -> 1, ImageSize -> Large]
yields something that's identical to the first plot, while
ListPlot[GatherBy[wrappeddata1, #[[1, 1]]^2 + #[[1, 2]]^2 > 1/4 &],
AspectRatio -> 1, ImageSize -> Large, PlotMarkers -> {"●", "×"}]
loses the coloring information:
(GatherBy
also has the problem that it doesn't reliably sort the values according whether they're inside or outside the desired region, but that's a side issue and easily solved if necessary. I'm really more concerned with retaining the coloring while using different marker styles.)