Filledcurves aera below|above 曲线

Filledcurves aera below|above curve

我尝试使用 demo 文件夹中的示例,我的目标是在我的蓝线上方和下方定义一个颜色区域
这是我得到的:

还有我想要的:

代码:

set style fill solid 0.50 noborder
set style data lines
set title "Fill area" 
set xrange [ 250.000 : 500.000 ] noreverse writeback
## Last datafile plotted: "silver.dat"
plot 'silver.dat' u 1:2:(+/50.) w filledcurves above notitle, \
     '' u 1:2 w filledcurves lc rgb "light-salmon" notitle, \
     '' u 1:(+/50.) lt 3 lw 2 title 'linemax"

首先需要注意的是

'' u 1:2 w filledcurves lc rgb "light-salmon" notitle, \

默认情况下将被解释为“filledcurves closed”。

“鲑鱼粉色”所需绘图的填充区域是两条曲线中最小值的包络线。表示包络的这条曲线不能由单个填充曲线表示,因为它在数据点的中间切换。作为解决方法,如何通过用背景颜色(白色)填充第二个图来使用两个填充曲线来表示包络?

set terminal wxt
set style fill solid 0.5 noborder
set style data lines
set title "Fill area" 
set xrange [ 250.000 : 500.000 ] noreverse writeback
## Last datafile plotted: "silver.dat"
plot 'silver.dat' u 1:2:(+/50.) w filledcurves above notitle, \
     ''           u 1:(+/50.)   w filledcurves y=0 lc rgb "light-salmon" notitle, \
     ''           u 1:2:(+/50.) w filledcurves below lt bgnd notitle, \
     ''           u 1:(+/50.)   w lines lt 3 lw 2 title 'linemax"

仅作记录,有一个更简单的解决方案。此外,它还具有允许透明背景的优点。

代码:

### "partially" filledcurves with transparent background
reset session

set term pngcairo transparent
set output "SO69085000.png"

$Data <<EOD
250   20   4.472136
260   20   4.472136
270   18   4.242641
280   18   4.242641
290   20   4.472136
300   12   3.464102
310   26   5.099020
320   17   4.123106
330    8   2.828427
340    6   2.449490
350    8   2.828427
360   10   3.162278
370   20   4.472136
380   14   3.741657
390    8   2.828427
400   10   3.162278
410    9   3.000000
420    8   2.828427
430   10   3.162278
440   13   3.605551
450    9   3.000000
460    5   2.236068
470    7   2.645751
480   11   3.316625
500    7   2.645751
EOD

set style fill solid 0.5 noborder
set key noautotitles
set tics out

plot $Data u 1:2             w filledcurves   y=0 lc "green", \
     ''    u 1:(+/50.):2 w filledcurves below lc "red", \
     ''    u 1:(+/50.)   w lines lt 3 lw 2 title 'linemax'
set output
### end of code

结果:(棋盘背景前透明PNG截图)