gnuplot multiple lines with Time on X axis -
i've had through questions still can't working.
my data set this:
[date] , [%cpu] , [mem] 23:00:39 , 21.9 , 2.1 23:00:44 , 21.8 , 2.1 23:00:49 , 21.8 , 2.1 23:00:54 , 21.8 , 2.1 23:00:59 , 21.7 , 2.1
my gnuplot statements (just started using data) is:
set timefmt "%h:%m:%s" set xdata time set datafile sep ',' plot '/tmp/info' using 2 title 'cpu' lines, '/tmp/info' using 3 title 'memory%' lines
i following error:
need full using spec x time data
i've tried autoscale x , i'm bit lost, appreciated.
time data requires specify columns used. (note corrected timefmt
):
set timefmt "%h:%m:%s" set xdata time set datafile sep ',' set style data lines plot '/tmp/info' using 1:2 title 'cpu', '' using 1:3 title 'memory%'
the reason is, timefmt
may contain spaces, data used time axis may come 2 columns. consider following modified data file:
23:00:39 06/08/13 21.9 2.1 23:00:44 06/08/13 21.8 2.1 23:00:49 06/08/13 21.8 2.1 23:00:54 06/08/13 21.8 2.1 23:00:59 06/08/13 21.7 2.1
the plotting commands format are:
set timefmt "%h:%m:%s %d/%m/%y" set xdata time set format x "%h:%m:%s" set style data lines plot 'mydata.dat' using 1:3 t 'cpu', '' using 1:4 t 'memory%'
to avoid confusion, required time data columns used plotting style (here with lines
) given explicitely using
statement.
Comments
Post a Comment