filledcurves
曲線の下の部分を塗りつぶすには、スタイルを使用する必要があります。オプションx1
を使用すると、曲線と x 軸の間の部分を塗りつぶします。
曲線の一部だけを埋めるには、データをフィルタリングする必要があります。つまり、x 値が1/0
目的の範囲外にある場合は (無効なデータ ポイント) の値を与え、そうでない場合はデータ ファイルから正しい値を与えます。最後に、曲線自体をプロットします。
set style fill transparent solid 0.35 noborder
filter(x,min,max) = (x > min && x < max) ? x : 1/0
plot 'data' using (filter($1, -1, -0.5)):2 with filledcurves x1 lt 1 notitle,\
'' using (filter($1, 0.2, 0.8)):2 with filledcurves x1 lt 1 notitle,\
'' using 1:2 with lines lw 3 lt 1 title 'curve'
[-1:0.5]
これにより、との範囲が満たされます[0.2:0.8]
。
実際の例を示すために、特別な filename を使用します+
。
set samples 100
set xrange [-2:2]
f(x) = -x**2 + 4
set linetype 1 lc rgb '#A3001E'
set style fill transparent solid 0.35 noborder
filter(x,min,max) = (x > min && x < max) ? x : 1/0
plot '+' using (filter($1, -1, -0.5)):(f($1)) with filledcurves x1 lt 1 notitle,\
'' using (filter($1, 0.2, 0.8)):(f($1)) with filledcurves x1 lt 1 notitle,\
'' using 1:(f($1)) with lines lw 3 lt 1 title 'curve'
結果 (4.6.4 の場合):

なんらかの平滑化を使用する必要がある場合は、フィルター処理された部分に応じて、フィルターがデータ曲線に異なる影響を与える可能性があります。最初に平滑化されたデータを一時ファイルに書き込んでから、これを「通常の」プロットに使用できます。
set table 'data-smoothed'
plot 'data' using 1:2 smooth bezier
unset table
set style fill transparent solid 0.35 noborder
filter(x,min,max) = (x > min && x < max) ? x : 1/0
plot 'data-smoothed' using (filter($1, -1, -0.5)):2 with filledcurves x1 lt 1 notitle,\
'' using (filter($1, 0.2, 0.8)):2 with filledcurves x1 lt 1 notitle,\
'' using 1:2 with lines lw 3 lt 1 title 'curve'