Is there a way to dynamically define a polygon on a plot (I'm working with ListPlot
and SmoothDensityHistogram
) to select a cluster of interest, and give the positions of those points in the original list of data?
I'd appreciate any help!
Here's just an example set of points:
x = {
{RandomReal[{0, 5}, 20],
RandomReal[{4, 4.5}, 10]},
{RandomReal[1, 20],
RandomReal[{1.5, 2}, 10]}
};
points = Transpose[Join @@@ x] ~RandomSample~ 30;
SmoothDensityHistogram[points, ColorFunction -> "TemperatureMap"]
ListPlot[points, PlotRange -> {{0, 5.5}, {0, 2.5}}]