time series - Gnuplot: x-axis narrow label spacing in timeseries plot -
gnuplot tends clutter x-axis in timeseries plots. see following image example of labels narrow spacing:
is there way make gnuplot avoid such narrow spacing? preferably should done within gnuplot script generate plot.
i generated plot following gnuplot script , file of random data:
set terminal png set output "plot.png" set timefmt "%s" set xdata time set xlabel "time" set ylabel "random data" set boxwidth 600 set style fill solid 0.5 set key below plot "random.dat" using 1:2 w boxes title ".60"
note: using gnuplot 4.6.
edit
- writing less times should sufficient this.
- an example file produce plot available @ http://pastebin.com/w0kia7dt
you can use set xtics
mark less points on x-axis. first , last argument must in same format times, in case %s
, or seconds since unix epoch. middle argument number of seconds.
for example, mark every 8 hours, rather every 4 above, this:
hours = 8 start = "1393934400" end = "1394107200" set xtics start, hours * 3600, end
you can obtain start , end values using date
command in terminal
date -d "2014-03-04 08:00" +%s
you them script using gnuplot system
command
end = system("date -d '2014-03-06 12:00' +%s")
see help set xtics time_axis
more details.
Comments
Post a Comment