Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3592

Re: gnuplot (fitting of ellipse)

From Karl Ratzsch <mail.kfr@gmx.net>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: gnuplot (fitting of ellipse)
Date 2017-03-24 12:25 +0100
Organization solani.org
Message-ID <ob2vmq$sqq$1@solani.org> (permalink)
References <1d68425b-6a98-4762-8f7a-3091b9198947@googlegroups.com> <9ff689bb-3cb6-4b40-be9e-3411d86743dd@googlegroups.com>

Show all headers | View raw


Am 24.03.2017 um 11:01 schrieb vineeth25396@gmail.com:
> I have also tried a sample code with x and y values in pnts.dat but I get nan during my fit command and in the end after the plot command I get warning: skipping data file with no valid points. Below are the x y values in pnts.dat

Works perfectly even if you only initialise the variables to 1

$dat << EOD
-2.000000   -0.005494
-1.789474   -0.410310
-1.578947   -0.616013
1.368421   0.760577
-1.157895   0.695609
-0.947368   0.921957
-0.736842   -0.882355
-0.526316   -1.031450
-0.315789   -0.910362
-0.105263   -0.986339
0.105263    -0.897862
0.315789    -1.059766
0.526316    -1.007012
0.736842    0.910494
0.947368    -0.878432
1.157895    0.823232
1.368421    0.831900
1.578947    -0.662069
1.789474    0.427903
2.000000    -0.001474
EOD

f(x, y) = x*x + b*x*y + c*y*y + d*x + e*y + f
b=c=d=e=f=1
fit f(x, y) $dat u 1:2:(0) via b,c,d,e,f
splot f(x,y), $dat us 1:2:(0)

But your formula still does not describe an ellipse.

f(x,y) = 0 does, which is what you fitted, and your want from the
contour plot.

 set contour both
 set cntrparam levels discrete 0
 set xr[-3:3]; set yr[-3:3]
 splot f(x,y), $dat us 1:2:(0)








Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

gnuplot (fitting of ellipse) vineeth25396@gmail.com - 2017-03-24 02:24 -0700
  Re: gnuplot (fitting of ellipse) vineeth25396@gmail.com - 2017-03-24 03:01 -0700
    Re: gnuplot (fitting of ellipse) Karl Ratzsch <mail.kfr@gmx.net> - 2017-03-24 12:25 +0100
      Re: gnuplot (fitting of ellipse) vineeth25396@gmail.com - 2017-03-24 17:55 -0700
        Re: gnuplot (fitting of ellipse) Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2017-03-25 14:22 +0100
  Re: gnuplot (fitting of ellipse) Karl Ratzsch <mail.kfr@gmx.net> - 2017-03-24 11:28 +0100

csiph-web