problem with abbreviated day in gnuplot
I am trying to plot a graph using gnuplot (v4.4.3)on linux with the input file containing time (X axis)and some other values. (Sample line - Tue Aug 2 17:00:09 2011 1.8 2.1 1.1 1.1 2.8) The time is the output from C functi开发者_开发问答on - asctime. However I am getting error whenever I try to plot. I am setting the time format as - %a %b %d %H:%M:%S %Y. But it always throws an error for illegal day of month,bad abbreviated month etc. I tested it on some other small file and found out that whenever there is abbreviated day in the file it blows up.The documentation says I will have to use %a for abbreviated day and I am doing just that.Please help me to fix this.
The problem you are having is that there is no %a - abbreviated name of day of the week
in set timefmt
and cannot be used therefore. It seems to exist however in the set format
specifier.
The following example should lead you the way:
set xdata time
set timefmt "%b %d %H:%M:%S %Y"
set format x "%H/%a"
plot "-" u 1:5 w lp
Aug 2 17:00:09 2011 1
Aug 3 02:00:09 2011 2
Aug 4 22:00:09 2011 3
Aug 5 04:00:09 2011 4
e
精彩评论