Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / margins.dem
1 #
2 # Demonstrate use of 'set {btlr}margin at screen <value>'
3 # to pin plot borders to a specific place on the canvas.
4 # This allows positioning multiple plots on the page so that their
5 # corners line up perfectly.
6 #
7 # Aug 2006 - Ethan A Merritt
8 #
9
10 set multiplot title "Demo of placing multiple plots (2D and 3D)\nwith explicit alignment of plot borders"
11
12 #
13 # First plot  (large)
14 #
15 set lmargin at screen 0.20
16 set rmargin at screen 0.85
17 set bmargin at screen 0.25
18 set tmargin at screen 0.90
19
20 set pm3d
21 set palette rgbformulae 7, 5, 15
22 set view map
23 set samples 50, 50
24 set isosamples 50, 50
25 unset surface
26 set xrange [ -15.00 : 15.00 ]
27 set yrange [ -15.00 : 15.00 ]
28 set zrange [ -0.250 : 1.000 ]
29
30 unset xtics
31 unset ytics
32
33 set key above
34
35 splot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2)
36
37 unset pm3d
38 unset key
39
40 #
41 # second plot  (tall and narrow; at left of main plot)
42 #
43 set lmargin at screen 0.10
44 set rmargin at screen 0.20
45
46 set ytics
47
48 set parametric
49 set dummy u,v
50 set view map
51
52 f(h) = sin(sqrt(h**2))/sqrt(h**2)
53
54 set urange [ -15.00 : 15.00 ]
55 set vrange [ -15.00 : 15.00 ]
56 set xrange [*:*]
57 set surface
58
59 splot f(u), u, 0 with lines lc rgb "green"
60
61 unset parametric
62
63 #
64 # third plot  (short and wide; at bottom of main plot)
65 #
66 set lmargin at screen 0.20
67 set rmargin at screen 0.85
68 set bmargin at screen 0.10
69 set tmargin at screen 0.25
70
71 set xrange [ -15.00 : 15.00 ]
72 set yrange [ * : * ]
73 set xtics
74 unset ytics
75
76 y = 0
77 plot sin(sqrt(x**2+y**2))/sqrt(x**2+y**2)
78
79 unset multiplot
80
81 pause -1 "Hit return to continue"
82 reset