Gnuplot曲线之间的透明阴影区域

时间:2018-02-15 17:44:17

标签: gnuplot

我有一个带有均值和标准差列的数据集。我可以在平均值的上方和下方绘制均值+西格玛和均值 - 西格玛曲线。现在我想要+ -sigma之间的浅色阴影,但仍然可以看到平均曲线。我尝试过以下透明设置,但仍未成功。

 set style fill transparent solid 0.5 noborder
 plot 'inter.dat' using 1:2 with linespoints lc "black", \
      'inter.dat' using 1:($2-$3)  with linespoints lc "blue", \
      'inter.dat' using 1:($2+$3)  with linespoints lc "blue", \
      'inter.dat' using 1:($2-$3):($2+$3) with filledcurves lc "skyblue" fs solid 0.5

示例数据:

 0.490  -5.809   +2.203 
 0.500  -1.293   +1.370 
 0.520  -1.026   +0.979 
 0.530  -0.877   +0.961 
 0.540  -0.656   +0.937 
 0.550  -0.878   +0.923 
 0.560  -0.649   +0.876 
 0.570  -0.729   +0.859 
 0.580  -0.370   +0.771 
 0.590  -0.421   +0.710 

感谢您的反馈。

1 个答案:

答案 0 :(得分:2)

您在第一个填充样式声明中指定transparent,但实质上会在plot命令中覆盖它。你可以做任何一件事

set style fill transparent solid 0.5 noborder
plot 'inter.dat' using 1:2 with linespoints lc "black", \
     'inter.dat' using 1:($2-$3)  with linespoints lc "blue", \
     'inter.dat' using 1:($2+$3)  with linespoints lc "blue", \
     'inter.dat' using 1:($2-$3):($2+$3) with filledcurves lc "skyblue" 

plot 'inter.dat' using 1:2 with linespoints lc "black", \
     'inter.dat' using 1:($2-$3)  with linespoints lc "blue", \
     'inter.dat' using 1:($2+$3)  with linespoints lc "blue", \
     'inter.dat' using 1:($2-$3):($2+$3) with filledcurves lc "skyblue" fs transparent solid 0.5

获取

enter image description here

另外,请记住并非所有终端都支持透明度;上面的图片是使用pngcairo生成的。