Gnuplot填充曲线

Gnuplot填充曲线,gnuplot,fill,Gnuplot,Fill,我试图使用gnuplot来填充某个x范围内的曲线和x轴之间的距离。例如,当x似乎没有“直接”的方法时,我想在f(x)=x行之间填充。克里斯托夫给出了一个解决方案 根据他的代码,我得出以下结论: set xrange [-10:10] set yrange [-10:10] filter_lt(x,xmax) = ((x < xmax) ? x : 1/0) f(x) = x xmax = 5 plot '+' using (filter_lt($1,xmax)):(f($1)) wit

我试图使用gnuplot来填充某个x范围内的曲线和x轴之间的距离。例如,当x似乎没有“直接”的方法时,我想在f(x)=x行之间填充。克里斯托夫给出了一个解决方案

根据他的代码,我得出以下结论:

set xrange [-10:10]
set yrange [-10:10]

filter_lt(x,xmax) = ((x < xmax) ? x : 1/0)
f(x) = x
xmax = 5

plot '+' using (filter_lt($1,xmax)):(f($1)) with filledcurves x1 lt 1 notitle,\
     '' using 1:(f($1)) with lines lw 2 lt 1 title 'f(x)=x'
设置xrange[-10:10]
设置Y范围[-10:10]
过滤器lt(x,xmax)=((x
似乎没有“直接”的方法。克里斯托夫给出了一个解决方案

根据他的代码,我得出以下结论:

set xrange [-10:10]
set yrange [-10:10]

filter_lt(x,xmax) = ((x < xmax) ? x : 1/0)
f(x) = x
xmax = 5

plot '+' using (filter_lt($1,xmax)):(f($1)) with filledcurves x1 lt 1 notitle,\
     '' using 1:(f($1)) with lines lw 2 lt 1 title 'f(x)=x'
设置xrange[-10:10]
设置Y范围[-10:10]
过滤器lt(x,xmax)=((x