【问题标题】:Gnuplot yerrorlines xtics issueGnuplot yerrorlines xtics问题
【发布时间】:2017-03-02 14:40:24
【问题描述】:

我在 2,2 multiplot 环境中使用 Gnuplot。

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

#   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

【问题讨论】:

    标签: gnuplot


    【解决方案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'
    

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多