X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=demo%2Fmargins.dem;fp=demo%2Fmargins.dem;h=9a43aabf93d694abf3dfd498aab671de949f1eb2;hb=39ec1247a71f61152a4a7f502a30f06a3896c5da;hp=0000000000000000000000000000000000000000;hpb=06be459be4f5f6a7c6ff878e84f355fb2575caa8;p=gnuplot diff --git a/demo/margins.dem b/demo/margins.dem new file mode 100644 index 0000000..9a43aab --- /dev/null +++ b/demo/margins.dem @@ -0,0 +1,82 @@ +# +# Demonstrate use of 'set {btlr}margin at screen ' +# to pin plot borders to a specific place on the canvas. +# This allows positioning multiple plots on the page so that their +# corners line up perfectly. +# +# Aug 2006 - Ethan A Merritt +# + +set multiplot title "Demo of placing multiple plots (2D and 3D)\nwith explicit alignment of plot borders" + +# +# First plot (large) +# +set lmargin at screen 0.20 +set rmargin at screen 0.85 +set bmargin at screen 0.25 +set tmargin at screen 0.90 + +set pm3d +set palette rgbformulae 7, 5, 15 +set view map +set samples 50, 50 +set isosamples 50, 50 +unset surface +set xrange [ -15.00 : 15.00 ] +set yrange [ -15.00 : 15.00 ] +set zrange [ -0.250 : 1.000 ] + +unset xtics +unset ytics + +set key above + +splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2) + +unset pm3d +unset key + +# +# second plot (tall and narrow; at left of main plot) +# +set lmargin at screen 0.10 +set rmargin at screen 0.20 + +set ytics + +set parametric +set dummy u,v +set view map + +f(h) = sin(sqrt(h**2))/sqrt(h**2) + +set urange [ -15.00 : 15.00 ] +set vrange [ -15.00 : 15.00 ] +set xrange [*:*] +set surface + +splot f(u), u, 0 with lines lc rgb "green" + +unset parametric + +# +# third plot (short and wide; at bottom of main plot) +# +set lmargin at screen 0.20 +set rmargin at screen 0.85 +set bmargin at screen 0.10 +set tmargin at screen 0.25 + +set xrange [ -15.00 : 15.00 ] +set yrange [ * : * ] +set xtics +unset ytics + +y = 0 +plot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2) + +unset multiplot + +pause -1 "Hit return to continue" +reset