Is there a way to dynamically define a polygon on a plot (I'm working with ListPlotListPlot
and SmoothDensityHistogramSmoothDensityHistogram
) 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:
pointsx = RandomSample[
Transpose[{Flatten[
{RandomReal[{0, 5}, 20],
RandomReal[{4, 4.5}, 10]}],
Flatten[ {RandomReal[1, 20],
RandomReal[{1.5, 2}, 10]}]
}],;
points 30];= Transpose[Join @@@ x] ~RandomSample~ 30;
SmoothDensityHistogram[points, ColorFunction -> "TemperatureMap"]
ListPlot[points, PlotRange -> {{0, 5.5}, {0, 2.5}}]