【发布时间】:2015-12-01 15:02:33
【问题描述】:
我正在使用
G N U P L O T
版本 4.6 补丁级别 4 上次修改时间为 2013 年 10 月 2 日
构建系统:Linux x86_64
我想用它来绘制大致像这样设置的文件中的数据
0.0 a1 b1
0.0 a2 b2
...
0.1 a1 b1*
0.1 a2 b2*
...
对于第一列中的每个唯一值,我想在 a 上绘制 b。为此,我创建了一个包含条件绘图的 do 循环
为 [t=0:34] {
打印 0.2000*t
plot 'twopi5101/profile.dat' u ($1==0.2000*t ? ($3-7.5) : 1/0):8 notitle w l lt 1 lc 1, \
'twopi5101/profile.dat' u ($1==0.2000*t ? ($3-7.5) : 1/0):9 notitle w l lt 1 lc 2
}
不幸的是,这个循环(以及其他文件的类似循环)会一直错过一些情节
0.0
0.2
0.4
0.6
警告:跳过没有有效点的数据文件
警告:跳过没有有效点的数据文件
更多> ;打印 0.2000*t;plot 'twopi5101/profile.dat' u ($1==0.2000*t ? ($3-7.5) : 1/0):8 notitle w l lt 1 lc 1, 'twopi5101/profile.dat ' u ($1==0.2000*t ? ($3-7.5) : 1/0):9 notitle w l lt 1 lc 2;
^
x 范围无效
但是,如果我手动输入 0.6 完全没有问题
gnuplot> plot 'twopi5101/profile.dat' u ($1==0.6 ? ($3-7.5) : 1/0):8 notitle w l lt 1 lc 1, \ 'twopi5101/profile.dat' u ($1==0.6 ? ($3-7.5) : 1/0):9 notitle w l lt 1 lc 2
gnuplot>
对于为什么会发生这种情况似乎没有合乎逻辑的解释,或者甚至是错过分数的模式。
间隔 [0.0:6.0] gnuplot 跳过:
0.6,1.2,1.4,2.4,2.8,3.4,3.8,4.6,4.8,5.6,5.8
并且每次我运行循环时它都会始终如一地运行,即使我只在该间隔的一部分上运行它(例如,从 0.6 运行到 2.0 将再次熟练 0.6、1.2 和 1.4)。
对于更大的间隔/更多的情节,我在许多其他情况下遇到了相同的行为。我不知道是什么甚至会导致这样的事情,或者我的循环格式是否有一些错误来解释它。
(我使用的终端是 'wxt' 或 postscript 增强型)
【问题讨论】:
标签: gnuplot