# Drawing a Closed Curve from given points

I have the following points:

aa={{238.5, 394.5}, {195.5, 441.5}, {219.5, 397.5}, {216.5,
398.5}, {246.5, 397.5}, {265.5, 476.5}, {275.5, 450.5}, {273.5,
435.5}, {274.5, 461.5}, {212.5, 447.5}, {221.5, 457.5}}


Now, I want to draw a closed curve from those line. So I used the following code:

Graphics[{{Blue, Point[aa]}, JoinedCurve[Line[aa], CurveClosed -> True]}]


But, it gives me curve like this:

I want the curve like this way:

Please let me know, how to do it. And, I want it to do automatically, not point by point. Please let me know. Thanks.

Note that the above method doesn't always work. Here is an alternative:

aa = RandomReal[{-1, 1}, {20, 2}];
Graphics[Line[aa[[Last[FindShortestTour[aa]]]]]]


• @Dr.belisarius Ah, didn't mean to sound competitive - just meant as an alternative! I am always learning from your answers anyway +1 :) – martin Mar 7 '16 at 22:36
• Don't worry, I was joking – Dr. belisarius Mar 7 '16 at 22:39
• it looks like a cute cat😃 – partida May 9 '16 at 13:48
• This also guarantees the curve is closed which is a plus – VivaLaPanda May 9 '18 at 17:48
curve = FindCurvePath[aa]
ListLinePlot[aa[[curve[[1]]]], AspectRatio -> Automatic]


Why not directly use ListCurvePathPlot?

ListCurvePathPlot@aa


• It appears that ListCurvePathPlot doesn't guarantee that the curve is closed. – VivaLaPanda May 8 '18 at 4:03
• @AdrianSmith Yeah, actually it's mentioned in the Details and Options of the document: ListCurvePathPlot can generate disconnected curves in certain cases. But it at least works for OP's case. – xzczd May 8 '18 at 5:26