0

I read some parameters from a text file using the following code:

H, OD, c, b, orc = np.genfromtxt('textfile.txt', unpack = True)

I plot them two by two using the simple code

plt.plot(H[i], c[i], 'bo')

Finally we have 10 plots for these 5 parameters. The plots are something like solid circle or solid elliptic or a closed solid figure using 300,000 points. similar to

this scatter plot

How could I plot the boundary line or fit line, I mean the outer line surrounded the figure. similar to

this plot
(source: springernature.com)

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
Ehsan
  • 73
  • 11
  • does [this](http://www.ozgrid.com/Excel/bound-chart-area.htm) help any? *The lowest x value point is chosen as the Starting point and the each other point is checked to find the one that causes the smallest change in angle.* This is O(n^2) by the way.. – Ma0 May 11 '18 at 09:15
  • If you can use Seaborn, you can use kdeplot: http://seaborn.pydata.org/generated/seaborn.kdeplot.html Otherwise, you will need to fit a Gaussian to your data by yourself and display a contour plot: https://stackoverflow.com/questions/4128699/using-scipy-stats-gaussian-kde-with-2-dimensional-data – Kefeng91 May 11 '18 at 09:18
  • @Ev.Kounis I am searching to find a way, library, module, etc to do that in Python. – Ehsan May 11 '18 at 09:19
  • @Ehsan It is the algorithm I meant, not its excel implementation but, yeah, there should be something ready to use. Take a look at Kef's suggestion. Seems promising! – Ma0 May 11 '18 at 09:20
  • Do you want a convex hull or a type of contour plot? – mikuszefski May 14 '18 at 08:38
  • @mikuszefski It can be convex hull but I need some exact model. and I dont know what is exist out there for this issue. – Ehsan May 24 '18 at 19:55
  • did you check [this](https://stackoverflow.com/questions/1768197/bounding-ellipse); might help. – mikuszefski May 28 '18 at 10:54

0 Answers0