|
From: <pl...@pi...> - 2016-02-05 08:45:33
|
Hi,
I have fitted an analytic fn to some data using gnuplot and now I want
to create a synthetic monthly dataset by outputting to "table".
Since gnuplot will always produce a point at start and end of range I
specify the plot range in integer years and set samples to (years-1)
*12 +1 to account for the last year in the range just having one datum
point.
plot [1978:2016] cos3(x) * cos2(x)
set samples (2015-1978)*12+1 # 445
set table "synth.txt"
rep
unset table
This gives the expected number of data lines but the dates are not
consistent from year to year. There is a small drift in the decimal part
of the dates.
Only a handful of data lines get an exact beginning of year , ie no
decimal part:
awk '($1 !~ /[0-9]\./){print}' "synth.txt"
# Curve 0 of 1, 445 points
# Curve title: "cos3(x) * cos2(x))"
# x y type
1978 -0.801801 i
1981 -0.895154 i
1994 -0.105538 i
1997 -0.733846 i
2000 -0.563258 i
2013 0.204895 i
2016 -0.168844 i
On a 200y range it worked as expected. Is there some rounding error
issue or trick I am missing?
Thanks, Peter.
|