Linux Gnuplot:将每个轴的每个值移动一次

Linux Gnuplot:将每个轴的每个值移动一次,linux,plot,gnuplot,Linux,Plot,Gnuplot,有些事情我需要你的帮助: 我有这类数据: 2019-10-08-13-37 /dev/hd1 256.00 26.25 /home 2019-10-08-18-00 /dev/hd1 256.00 25.86 /home 2019-10-09-00-00 /dev/hd1 256.00 25.68 /home 2019-10-09-06-00 /dev/hd1 256.00 25.5 /home 2019-10-09-12

有些事情我需要你的帮助:

我有这类数据:

2019-10-08-13-37    /dev/hd1    256.00  26.25   /home
2019-10-08-18-00    /dev/hd1    256.00  25.86   /home
2019-10-09-00-00    /dev/hd1    256.00  25.68   /home
2019-10-09-06-00    /dev/hd1    256.00  25.5    /home
2019-10-09-12-00    /dev/hd1    256.00  26.32   /home
2019-10-09-18-00    /dev/hd1    256.00  26.14   /home
我有一个gnuplot脚本:

set terminal pngcairo truecolor size 7330, 340  background rgb "#eff1f0" font "Arial"

set output "/xxx/xxx/www/xxx/foo.png"
set style line 1 \
    linecolor rgb '#0060ad' \
    linetype 1 linewidth 1 \
    pointtype 7 pointsize 1

set size 1, 1
set key outside vertical center right
set datafile separator ";"
set xlabel "DATE" font ",1"
set xtics rotate by 90 offset 0, -2 font ",7"
set format y "%g"


plot "/xxx/xxx/xxx/xxx/data.txt" using 3:xtic(1) with linespoints linestyle 1 title "total"
允许显示此图形的:

我想这样贴花每个值:

254
|
|
253
|
|___my_date1___my_date2


但我不知道怎么做。。。您能给我看一下吗?

您的问题的快速解决方法可能是:

set offsets 1,1,1,1   # left, right, top, bottom
在gnuplot控制台中,检查帮助偏移量

如果您正在绘制时间数据,我不会对xtic标签使用
xtic(1)
。如果您有数千个数据点,那么您将有数千个XTIC

请尝试下面的代码。gnuplot将自动缩放,您可能不需要偏移量

代码:

### plotting time data
reset session

$Data <<EOD
2019-10-08-13-37    /dev/hd1    256.00  26.25   /home
2019-10-08-18-00    /dev/hd1    256.00  25.86   /home
2019-10-09-00-00    /dev/hd1    256.00  25.68   /home
2019-10-09-06-00    /dev/hd1    256.00  25.5    /home
2019-10-09-12-00    /dev/hd1    256.00  26.32   /home
2019-10-09-18-00    /dev/hd1    256.00  26.14   /home
EOD

myTimeFmt = "%Y-%m-%d-%H-%M"
set format x "%Y-%m-%d\n%H:%M" time

plot $Data u (timecolumn(1,myTimeFmt)):4 w lp pt 7 title "my data"
### end of code
###绘制时间数据
重置会话

我不明白你的意思。你的意思是旋转日期还是删除时间,或者两者兼而有之?我想移动每个值,以便在交点上没有第一个值。就像这样: