1
$\begingroup$

I have a lot of points' coordinates. I drew them on a 2d plot with ListPlot, and the points cover an area. Then I need to get the region that cover these points. Is there a way to do that? Thanks.

$\endgroup$
  • $\begingroup$ You mean the minimum-area convex region that includes all the points. (This is the ConvexHull.) $\endgroup$ – David G. Stork Feb 12 '15 at 23:40
3
$\begingroup$

I'm pretty sure that you are asking about convex region. Without this statement one can draw very weird region:

SeedRandom[1];
pts = RandomReal[{-1, 1}, {50, 2}];
Show[Graphics@{LightBlue, EdgeForm@Lighter@Blue, 
   Polygon@Deintersect[pts]}, ListPlot[pts]]

enter image description here

Deintersect is defined here.

$\endgroup$
2
$\begingroup$

ConvexHullMesh :

pts = RandomReal[{-1, 1}, {50, 2}];

Show[ConvexHullMesh[pts], ListPlot[pts]]

enter image description here

For earlier versions see ConvexHull.

$\endgroup$
0
$\begingroup$

Yet another area defined by the list of points:

SeedRandom[1];
pts = RandomReal[{-1, 1}, {50, 2}];
Graphics[{Blue, Point @ pts,
  LightBlue, EdgeForm @ Gray, Polygon @ pts[[FindShortestTour[pts][[2]]]]}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.