Gnuplot yerrorlines xtics问题

时间:2017-03-02 14:40:24

标签: gnuplot

我使用Gnuplot和2,2多色情环境。

我的一个数据集如下所示:

#   Avg1. Min1. Max1. Avg2. Min2. Max2. 
25  0.049 0.002 0.108 0.051 0.004 0.102
50  0.034 0.005 0.070 0.036 0.004 0.086
100 0.028 0.012 0.044 0.026 0.012 0.054

我使用以下脚本绘制第一个图表(我想一旦我得到第一个图表就可以重复代码):

#!/usr/bin/env gnuplot

set term post eps color solid enh
set multiplot layout 2,2 rowsfirst
set grid ytics
set offsets 0.5, 0.5
unset key
set ylabel offset 1,0
set xtics ("25" 1, "50" 2, "100" 3)

### First plot
set tmargin at screen 0.95
set bmargin at screen 0.65
set lmargin at screen 0.10
set rmargin at screen 0.45
set ylabel 'Y-Label Here'
plot 'data.dat' u :2:3:4 w yerrorlines ti 'Title1', \
     '' u :5:6:7 w yerrorlines ti 'Title2'

### three other graphs

unset multiplot

我还有三个这样的情节。问题是我的X轴只显示25和50(如下所示)。 我不知道如何解决这个问题。有人可以帮忙吗? 我尝试使用1:2:3:4代替,但它显示了中间的X-tics,我不想表现出来。

PlotExample

1 个答案:

答案 0 :(得分:1)

如果你没有为x值指定显式列,那么gnuplot使用行索引,从零开始:

set xtics ("25" 0, "50" 1, "100" 2)
plot 'data.dat' u 0:2:3:4 w yerrorlines ti 'Title1'

您也可以直接将第一列中的值用作xticlabels:

plot 'data.dat' u :2:3:4:xtic(1) w yerrorlines ti 'Title1'