Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / rectangle.dem
1 # demo for the use of "set object rectangle"
2 #
3 # Ethan A Merritt - 2006
4
5 if ((GPVAL_VERSION == 4.1 || GPVAL_VERSION == 4.2) \
6 &&  (!strstrt(GPVAL_COMPILE_OPTIONS,"+OBJECTS"))) \
7     print ">>> Skipping demo <<<\n" ; \
8     print "This copy of gnuplot was built without support for placing rectangles\n" ; \
9     exit ;
10
11
12 set style line 1 bgnd
13 set style line 2 lt rgb "cyan"
14
15 set object 1 rect from 0,0 to 1,4 fc lt 2
16 set object 2 rect from -1,1 to 0,5 fc rgb "gold"
17 set object 5 rect from 0, -3 to 2, -2 fc ls 2 fs pattern 1 bo -1
18
19
20 set style fill pattern 2 bo 1
21
22 #
23 # Illustrate putting a different color under the key box
24 #
25 set key nobox
26 set object 7 rect from graph 0.65,graph 0.85 to graph 0.99, graph 0.99 fc ls 1
27
28 #
29 # Illustrate using character widths to put a box around a label
30 #
31 LABEL = "Label in a box"
32 set obj 10 rect at -3,-4 size char strlen(LABEL), char 1 
33 set obj 10 fillstyle empty border -1 front
34 set label 10 at -3,-4 LABEL front center
35
36 set obj 9 rect from -4, -4 to -4, -3 fc lt -1
37
38 set obj 20 rect from graph 0, graph 0 to graph 1, graph 1 fs solid 0.15 fc rgb "#FFD700" behind
39
40 plot [-5:5] x, -3+sin(x*5)/x lt 3 lw 3
41
42 pause -1 "Hit return to continue"
43
44 reset
45
46 #
47 # Requires data file "using.dat" from this directory,
48 # so change current working directory to this directory before running.
49 #
50
51 set xrange [1:8]
52 set title "Convex     November 1-7 1989"
53 set key below
54 set label "(Weekend)" at 5,25 center
55
56 set style rect fc lt -1 fs solid 0.15 noborder
57
58 set obj rect from 1, graph 0 to 2, graph 1
59 set obj rect from 3, graph 0 to 4, graph 1
60 set obj rect from 5, graph 0 to 6, graph 1
61 set obj rect from 7, graph 0 to 8, graph 1
62
63 plot 'using.dat' using 3:4 title "Logged in" with impulses,\
64      'using.dat' using 3:5 t "Load average" with points,\
65      'using.dat' using 3:6 t "%CPU used" with lines
66
67 pause -1 "Hit return to continue"
68
69 reset