This is a bit similar to the question mixing date and time on gnuplot xaxis. It's basically about extracting the timestamp for the first noon based on the first date in your data file. Then you can use this timestamp as start for setting the xtics.
The extraction of the first noon is done with stats
, strptime
and some other time functions:
reset
fmt = "%Y-%m-%dT%H:%M"
set datafile separator ','
stats 'test.txt' using (strptime(fmt, strcol(2))) every ::::0 nooutput
t = int(STATS_min)
t_start_midnight = t - tm_hour(t)*60*60 - tm_min(t)*60 - tm_sec(t)
t_start_noon = t_start_midnight - 12*60*60
Then you can plot your data with
set xdata time
set timefmt fmt
set xtics t_start_noon, 24*60*60
set format x '%a'
plot 'test.txt' using 2:1 with lp pt 7 ps 2 notitle
Note, that stats
doesn't work in time mode, and must be invoked before set xdata time
.
