The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

carminat (49) [Avatar] Offline
[ 256 KB ]
[ 46 KB ]
[ 46 KB ]
I have the following script which deals with time series

set xdata time
set format x "%d%b%y"
set xtics rotate by 90 offset 0,-3
set bmargin 10
set datafile separator ";"

set grid
set key left
set timefmt "%d/%m/%Y"

plot [:][:]    "2015d.csv"     u (timecolumn(3,"%d/%m/%Y")):(1) smooth  cumulative w l lt 3 t "bbb"

The output should be a statistic of the events recorded in the file 2015d.csv (in attach), and yet I get two lines
(see picture global1.png).

This does not happen if I gave the (apparently equivalent) final plot command
plot [:][:]  "2015d.csv"     u 3:(1) smooth  cumulative w l lt 7 t "global2015" 

What happens is that with the first plot command gnuplot produces two separate cumulative functions which should be summed up to get the true result.
carminat (49) [Avatar] Offline
Weird behaviour of time series - problem solved!
I used the "set table" directive to investigate this weird behaviour and I have found the reason: at line #564 of the file 2015d.csv there is a missing data.

What happens is that the first command inserts a blanc line and restarts the counting, while the second command quietly dismisses the problem, and goes on counting. This is the reason of the different behaviour.

Good to know!