【发布时间】:2016-02-07 05:36:26
【问题描述】:
我正在尝试使用 gnuplot 绘制一些数据的堆叠直方图,但它跳过了第一个 bin(数据文件的第一行)。
数据为:
1 0.2512 0.0103 0.9679
2 0.4730 0.2432 0.8468
3 0.6669 0.2826 0.6895
4 0.6304 0.2268 0.7424
情节代码是
set title "Data"
set key invert reverse Left outside
set key autotitle columnheader
set style data histogram
set style histogram rowstacked
set style fill solid border -1
#set boxwidth 0.75
plot 'data.dat' using 2:xtic(1) title 'X', '' using 3 title 'Y', '' using 4 title 'Z'
输出为。我检查了它,它正确显示了数据文件的第 2、3、4 行的数据。为什么我错过了第一个垃圾箱..?
非常感谢!
我已经在没有帮助的情况下检查了这个:Using gnuplot for stacked histograms
【问题讨论】:
-
为什么是
set key autotitle columnheader? -
可能从旧的剪切和粘贴中结束,并没有做太多你是对的.. 删除它并且情节行中的标题表明 gnuplot 将第一行作为标题列,因此添加一个标题为第一行的虚拟行解决了问题
-
我真的不知道为什么这个问题被否决了。我觉得这真的很有用!