Back to demo index

gnuplot demo script: smooth_path.dem

autogenerated by webify.pl on Fri May 24 14:07:12 2024
gnuplot version gnuplot 6.0 patchlevel 1
#
# Along-path cubic spline smoothing
#
$CURVES << EOD
1   2
1.5 2
2   2.5
3   5
2.5 5
1.5 4

3   3
3.5 3.1
3.7 3.2
3.6 3.7
3.5 4.0
3.2 3.5
3   3

1 5
2 5
3 6
1 5
EOD

set xrange [0:6]
set yrange [0:6.2]
set border 3
set tics nomirror
set style fill transparent solid 0.2 border lt 8

set title "Along-path spline fit to multiple sets of points\n"

plot $CURVES using 1:2 with points ps 2 lc "steelblue" title "original points", \
     '' using 1:2 smooth path with filledcurves closed title "smooth path with filledcurves closed"


Click here for minimal script to generate this plot




$LOOP << EOD
1.5 0.5
2.5 0.5
3   1.0
3.5 1.5
4.0 3.5
3.6 4.5
3.0 2.5
4   1.5
5   1.5
EOD

set title "Along-path spline fit to multiple sets of points\n(some open and some closed)"
plot $CURVES using 1:2 with points pt 7 ps 2 lc "steelblue" title "original points", \
     '' using 1:2 smooth path with lines lt 3 title "smooth path with lines", \
     $LOOP using 1:2 with points pt 7 ps 2 lc "steelblue" notitle, \
     '' using 1:2 smooth path with lines lt 3 notitle


Click here for minimal script to generate this plot