Back to demo index

gnuplot demo script: fillbetween.dem

autogenerated by webify.pl on Sun Sep 17 19:54:22 2023
gnuplot version gnuplot 6.0 patchlevel rc2
#
# Demonstrate filling the area between two curves
# and also the application of fillstyle to filled curves.
# Ethan Merritt  <merritt@u.washington.edu>
# June 2004
#
set title "Fill area between two curves"
set style data lines
set xrange [10:*]
set yrange [0:175]
plot 'silver.dat' u 1:2:3 "%lf %lf %lf" w filledcu, \
      '' u 1:2 lt -1 notitle, '' u 1:3 lt -1 notitle

Click here for minimal script to generate this plot



set style fill pattern 2
set title "Fill area between two curves (pattern fill)"
replot

Click here for minimal script to generate this plot



set title "Fill area between two curves (above/below)"
set style fill solid 1.0 noborder
set xrange [250:500]
set auto y
plot 'silver.dat' u 1:2:($3+$1/50.) w filledcurves above title 'Above', \
               '' u 1:2:($3+$1/50.) w filledcurves below title 'Below', \
	       '' u 1:2 lt -1 lw 2 title 'curve 1', \
	       '' u 1:($3+$1/50.) lt 3 lw 2 title 'curve 2'

Click here for minimal script to generate this plot



set title "Fill area between two smoothed curves (above/below)"
plot 'silver.dat' u 1:2:($3+$1/50.) smooth csp w filledcurves above lt 3 title 'Above', \
               '' u 1:2:($3+$1/50.) smooth csp w filledcurves below lt 4 title 'Below', \
	       '' u 1:2 smooth csp with lines lt -1 lw 2 title 'curve 1', \
	       '' u 1:($3+$1/50.) smooth csp with lines lt 1 lw 2 title 'curve 2'

Click here for minimal script to generate this plot