set samples , consistency

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

set samples , consistency

Plotter-2
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.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Reply | Threaded
Open this post in threaded view
|

Re: set samples , consistency

sfeam

On Friday, 05 February, 2016 08:38:42 [hidden email] wrote:

> 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?

 

Leap years?

 

The leap-year cycle is 200 years.

 


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta