Re: How to fit data in a restricted range?
- From: Giulio Bottazzi <g1ul10@xxxxxxxxx>
- Date: Tue, 20 Jun 2006 09:22:06 GMT
On Mon, 19 Jun 2006 18:26:14 +0000
Tom <xxx@xxxxxxxxxx> wrote:
I am only a basic level gnuplot user. I know plot command, f(x)= etc.
But the fitting is to fit the whole range of data. I hope to learn how
to fit only the selected range of data. Of course, one way is to delete
the un-wanted data range in the original data file and only plot the
selected data. But I hope there is some better way. Thank you very much
for your help.
If you use an OS which implements pipes (|), like Linux, for instance,
you can filter your data with an external program before passing it to
gnuplot fitting function. You can choose among several alternatives,
but for this kind of stuff I find (g)awk unbeatable. Assuming your data
file is "my.dat", and assuming you want to fit only the points with x
values between 1 and 10, you can use (g)awk to filter your data like
this
fit a*x+b "< gawk '{if($1>1 && $1<10) print $0}' my.dat " via a,b
(caveat: I wrote this without checking if it actually works) for a
brief description of what's going on, check
gnuplot> help special-filename
A "man gawk" (or "man awk") will give you all the necessary details...
and many more!
Hope this could help.
Giulio.
.
- Prev by Date: Problem with multiplot and clear in epslatex terminal
- Next by Date: Re: aligning 2d and 3d plots with multiplot
- Previous by thread: Problem with multiplot and clear in epslatex terminal
- Next by thread: Re: How to fit data in a restricted range?
- Index(es):
Relevant Pages
|
Loading