|
From: sfeam <sf...@us...> - 2015-09-28 05:43:53
|
On Sunday, 27 September 2015 08:50:54 AM pl...@pi... wrote: > Hi > > I have subset of a datafile that I can plot with plot command by > defining a range. > The same range parameter is refused by fit: > > f(x)=a*exp(-(x-t0)/b)+c > format="%Y%m%d %H %M" > set timefmt format > set xdata time > plot ["20150925 02 33": "20150925 07 14"] "valana.txt" u 1:4 w l > > a=b=c=t0=1; fit f(x) ["20150925 02 33": "20150925 07 14"] > "data.txt" u 1:4 via a,b,c > > > data looks like this: > > 20150923 15 20 22.3 16.1 > 20150923 15 40 22.3 16.1 > 20150923 15 49 22.9 16.4 > > The fit command shows the following error: > > internal error: substring range specifiers must have integer values > > > I thought the intention was that the two commands functioned in a > similar way. Why can't fit accept the range specifier in the same format > as plot? This doesn't answer your question of why that particular command fails, but ... As always, I recommend never placing a range specifier inside the plot (or fit) command. Instead use: set xrange ["20150925 02 33": "20150925 07 14"] plot "valana.txt" u 1:4 w l a=b=c=t0=1; fit f(x) "data.txt" u 1:4 via a,b,c Does that work better? Ethan |