两个数据集的两条曲线之间的Gnuplot着色

时间:2018-04-04 19:17:31

标签: gnuplot

我有gnuplot代码来遮蔽两条曲线之间的区域。即像mean + - stddev这样的错误区域。 mean和stddev是数据文件中的行。现在我有两个这样的数据文件,我希望它们在同一个图中。我只是附加了图cmds,但看起来第二条曲线没有得到阴影填充。我正在使用pngcairo终端。

数据1:

 0.550 -0.131323 0.280289
 0.570 -0.145116 0.264563
 0.600 -0.275901 0.298501
 0.625 0.031135 0.277453
 0.660 -0.302773 0.300036
 0.700 0.039286 0.372996
 0.780 -0.099013 0.294711
 0.840 0.007641 0.294503
 0.960 -0.033036 0.435880

数据2:

 0.500 0.013809 0.028914
 0.550 -0.025318 0.038805
 0.570 -0.081928 0.042251
 0.600 -0.083926 0.060722
 0.625 -0.043033 0.074957
 0.660 0.027737 0.109750
 0.700 -0.017666 0.098800
 0.780 -0.252330 0.240454
 0.840 0.069862 0.231550
 0.960 -0.123103 0.504706

代码:

 data1 = "data1.dat"
 data2 = "data2.dat"
 set terminal pngcairo size 1200,800
 set output plot.png
 set grid ytics lw 1 lt 0
 set grid xtics lw 1 lt 0
 plot data1 using 1:2 with linespoints lc "black" title 'Mean', \
      data1 using 1:($2-$3)  with linespoints lc "blue" title 'Mean-sigma', \
      data1 using 1:($2+$3)  with linespoints lc "blue" title 'Mean+sigma', \
      data1 using 1:($2-$3):($2+$3) with filledcurves lc "skyblue" fs transparent solid 0.5 notitle, \
      data2 using 1:2 with linespoints lc "black" title 'Mean', \
      data2 using 1:($2-$3)  with linespoints lc "red" title 'Mean-sigma', \
      data2 using 1:($2+$3)  with linespoints lc "red" title 'Mean+sigma', \
      data2 using 1:($2-$3):($2+$3) with filledcurves lc "tomato" fs transparent solid 0.5 notitle
 set output
 set term X11

第二个数据集中不需要的输出缺少番茄阴影区域。如果可以遮蔽第二个区域,我希望在两个区域重叠的情况下应用混合颜色。

enter image description here

您表示赞赏。

0 个答案:

没有答案