【发布时间】:2015-06-16 16:00:11
【问题描述】:
这个问题与gnuplot histogram: How to put values on top of bars有关。
我有一个数据文件file.dat:
x y1 y2
1 2 3
2 3 4
3 4 5
还有 gnuplot:
set style data histogram;
set style histogram rowstacked;
plot newhistogram 'foo', 'file.dat' u 2:xtic(1) t col, '' u 3 t col;
现在我想将第 2 列和第 3 列的 sums 放在条形上方。显而易见的解决方案
plot newhistogram 'foo', 'file.dat' u 2:xtic(1) t col, '' u 3 t col, \
'' u ($0-1):($2+$3+0.2):($2+$3) notitle w labels font "Arial,8";
将标签放在正确的位置,但计算的总和是错误的。也就是说,在($0-1):($2+$3+0.2):($2+$3) 中,第二个$2 的计算结果似乎为零。
这里出了什么问题,我该如何解决?
【问题讨论】: