ind*_*i60 3 gnuplot stacked curves
目前我在Gnulot堆叠填充曲线上工作.我有问题让我的图形堆叠.这是我的数据:
prog reli perf avail sec cons topo scale qos
2011 138 90.3 21.0 63.5 45.5 48.5 6.8 4.0 5.5
2012 191.3 77.8 90.8 30.8 29.0 22.1 2.0 1.0 1.0
2013 85.0 57.5 48.0 20.0 27.5 8.5 0 2.5 1.0
2014 2.0 0.5 1.0 2.0 1.0 1.5 0 0 0
Run Code Online (Sandbox Code Playgroud)
我画了t1.plt
set term pos eps font 20
set output 't1.eps'
set pointsize 0.8
set border 11
set xtics out
set tics front
set key below
set multiplot
a=0
plot for [i=1:9] "t1" using (column(i)):xtic(1) t column(i) with filledcurves
Run Code Online (Sandbox Code Playgroud)
我目前的输出:

我期望创建像这样的链接:

以下是如何使用gnuplot执行此操作的方法.您可以使用该sum命令对列值进行求和,以获得堆叠图:
set terminal postscript eps color font 20
set output 't1.eps'
set xtics 1 out
set tics front
set key invert
set style fill solid noborder
plot for [i=10:2:-1] "t1" using 1:(sum [col=2:i] column(col)) with filledcurves x1 title columnheader(i-1)
Run Code Online (Sandbox Code Playgroud)
请注意,列标题的索引是1..9,而值从2..10开始.所以你必须明确使用title columnheader(i-1).如果你给第一列也是一个标题,例如year,你可以使用set key autotitle columnheader.
不幸的是,该invert选项set key仅适用于列.因此,如果您使用set key below invert,则不会获得数据文件的原始顺序.
结果与4.6.4:
