Xtics与GnuPlot和大量数据点的距离太近

Xtics与GnuPlot和大量数据点的距离太近,gnuplot,Gnuplot,我试图绘制大约15k个不同的数据点。我已经尝试了我能想到的所有不同的变体来减少XTIC的数量,但是我似乎无法改变它们被绘制的频率 这是我的gnuplot文件: reset # need to call with two variables -e "filename='...'" -e "machine='...'" set title machine." Activity ".filename set datafile separator "," set autoscale x set auto

我试图绘制大约15k个不同的数据点。我已经尝试了我能想到的所有不同的变体来减少XTIC的数量,但是我似乎无法改变它们被绘制的频率

这是我的gnuplot文件:

reset
# need to call with two variables -e "filename='...'" -e "machine='...'"
set title machine." Activity ".filename
set datafile separator ","
set autoscale x
set autoscale y
set autoscale y2
set yrange [0:*]
set y2range [0:*]
set y2tics
set style data lines
set ylabel "% CPU"
set xlabel "Time"
set y2label "Memory (MB)"
set bmargin 7 # room for the xtic label
set term pngcairo size 960,720
set output filename.".png"
# I've also tried autofreq and explicit labels
set xtics axis out rotate 90 scale 0.5 (20101939, 1000000, 25102219)
plot filename \
  using 2:xtic(1) title "CPU" with points pt 1 axes x1y1, \
  "" using ($3 / 1024 / 1024):xtic(1) title "Memory" with points pt 1 axes x1y2
我的数据格式为:

datetime(ddHHMMss), %cpu, mem-in-bytes, pid, process-alias, process-name
我的数据如下所示(大约每30秒对15k条记录进行一次采样):

尽管我的xtics命令具有明确的开始、间隔和结束,但我的图形总是以xtic标签重叠结束。下面是它的样子:


要过滤tic标签,请将
xtic(1)
替换为打印非空白标签的标准。例如,这将每25个标签打印一次

 plot filename \
   using 2:xtic( int($0)%25 ? "" : strcol(1) ) title "CPU" with points pt 1
int($0)是行号;strcol(1)是作为字符串读取的第1列的内容

 plot filename \
   using 2:xtic( int($0)%25 ? "" : strcol(1) ) title "CPU" with points pt 1