I have a pandas dataframe with two columns and around 50 rows. I want to create a scatter plot of the two columns but I also want to have the datapoints connected to each other. So I did something like this:
plt.plot(df['colA'], df['colB'], 'o-')
plt.show()
I am getting an output like this:

But I want to have data points connected to each other so as to give an ellipse circumscribing the data points. I feel like the reason I'm getting this plot is that in the dataframe that's how the datapoints are sequenced. Is there a way to deal with this?
Any help would be appreciated! Thanks in advance
(xc, yc), that's within the circle (say the vector average of all the points) , and thenA = atan2(y-yc, x-xc), and order by column A.ConvexHullto get this done: stackoverflow.com/questions/36763853/…