1
votes

I have data of CPU utilization from monitoring. Monitoring does not start at first second of minute, but Gnuplot starts vaules of X axis at beginning of this minute. And missing seconds are filled with gaps (before and after graph of data).

Is it able to start axis X with my data and no gap?

I can not use: set xrange [ "13:12:24.8" : "13:21:24.8" ] with first and last value of monitored range of time. Because I monitor it many times a day. And I want grid in graph every 1 or 2 minutes.

my data:

column 1  ... col 195 
13:12:24.8   0.78061899
13:12:25.8   5.969546498
13:12:26.8   17.21257881
...
13:21:24.8   6.922475345

gnuplot script:

!/usr/bin/gnuplot
set terminal png size 1280,800
set output "CPU.png"
set title "CPU"
set xlabel "time"
set ylabel "%"
set xdata time
set timefmt "%H:%M:%S"
set format x "%H:%M:%S"
set format y "%10.0f"
set yrange [ 1 : 100 ]
set grid

#source file and collumns for axes x,y
#CPU collumns: User Time: 196 ; Proccessor Time: 195

plot "perfmon.txt" using 1:196 title "User Time" with lines, \
"perfmon.txt" using 1:195 title "Processor Time" with lines

Graph showing the gaps:

graph showing the gaps

1

1 Answers

2
votes

These "gaps" are caused by gnuplot's default behavior to extend axis ranges to the next full tic. To avoid this for the x-axis, use

set autoscale xfix