I have a numpy array coordinates
which contains certain number of x-y
coordinates. The elements of the array are:
coordinates = [[101 161]
[104 187]
[109 212]
[117 237]
[130 260]
[147 282]
[166 301]
[189 317]
[215 319]
[240 309]
[261 290]
[280 266]
[293 239]
[299 211]
[299 181]
[297 153]
[294 124]
[107 149]
[113 133]
[129 125]
[147 124]
[163 129]
[195 124]
[212 113]
[231 108]
[251 108]
[267 119]]
The corresponding scatter plot of the above points is shown below:
Now, I want to connect all the points and generate a smooth curve(as smooth as possible). How can I do that using numpy/scipy
?
P.S: I have looked at the documentation of scipy's
various interpolation method but I don't know which one will be better for my case and why?