Gnuplot填充误差线为透明阴影

时间:2019-04-06 16:09:29

标签: 2d gnuplot transparency errorbar

enter image description here

大家好,

我输入的数据为:

x(1),y(2),z(2)

x(2),y(2),z(2)

以此类推,

其中x和y值分别在x轴和y轴上,z值是误差线。 从Gnuplot,我该如何重现图形,其中多个图形的误差线是透明的?

有什么主意吗? 谢谢!

1 个答案:

答案 0 :(得分:2)

绘图样式with filledcurves可以与3列输入数据一起使用以产生阴影区域。中心线必须分开绘制。 Gnuplot需要输入

x y1 y2

因此,如果您的数据采用x,y,delta-y格式,则可以通过在using说明符中构造y1和y2来构造gnuplot命令

set term png truecolor  # or "set term pngcairo"
set output 'fill.png'
#
set style fill transparent solid 0.25 # partial transparency
set style fill noborder # no separate top/bottom lines
plot 'data' using 1:2 with lines lc "blue" title "Force", \
     'data' using 1:($2-$3):($2+$3) with filledcurves lc "blue" notitle, \
     'data' using ($1-Shift):2 with lines lc "green" title "Shift", \
     'data' using ($1-Shift):($2-$3):($2+$3) with filledcurves lc "green" notitle

enter image description here