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


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

Re: Obtain data points of a line from gnuplot

From Ethan A Merritt <EAMerritt@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Obtain data points of a line from gnuplot
Date 2016-02-15 21:56 -0800
Organization A noiseless patient Spider
Message-ID <n9udg2$qtc$1@dont-email.me> (permalink)
References <65879cc4-a1af-4e93-9850-a2d045a8ee89@googlegroups.com>

Show all headers | View raw


jamie.unix@gmail.com wrote:

> Hi all,
> 
> I have been stumped with this for quite a while now. I remember that I
> could do this with gnuplot, but have been struggling to find the
> correct documentation.
> 
> Consider I have a data file with a few x and y coordinates, lets say
> 
> 0 0
> 10 10
> 20 20
> 30 30
> 
> and if I call gnuplot to plot this file as follows:
> 
> plot 'input.txt' using 1:2 with l ls 1
> 
> The generated graph is a straight line with a certain slope. Is it
> possible to obtain the coordinates of the line as shown in gnuplot's
> output, with a certain resolution?


Part 1) Fit a line a*x+b to the points:

a = b = 0
fit a*x+b "file.dat" using 1:2 via a,b

Part 2) Draw the line into a table so that you can read out the coordinates

set table
plot a*x + b



> For example, the expected result would be something like
> 
> 0 0
> 1 1
> 2 2
> 3 3 ... and so forth.
> 
> Appreciate your help.
> Jamie.

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


Thread

Obtain data points of a line from gnuplot jamie.unix@gmail.com - 2016-02-15 09:10 -0800
  Re: Obtain data points of a line from gnuplot Jörg Buchholz <bookwood4news@freenet.de> - 2016-02-15 20:00 +0100
  Re: Obtain data points of a line from gnuplot Ethan A Merritt <EAMerritt@gmail.com> - 2016-02-15 21:56 -0800

csiph-web