Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / heatmaps.dem
1 #
2 # Two ways of generating a 2D heat map from ascii data
3 #
4 if ((GPVAL_VERSION == 4.1 || GPVAL_VERSION == 4.2) \
5 &&  (!strstrt(GPVAL_COMPILE_OPTIONS,"+IMAGE"))) \
6     print ">>> Skipping demo <<<\n" ; \
7     print "This copy of gnuplot was built without support for plotting images" ; \
8     exit ;
9
10 set title "Heat Map generated from a file containing Z values only"
11 unset key
12 set tic scale 0
13
14 # Color runs from white to green
15 set palette rgbformula -7,2,-7
16 set cbrange [0:5]
17 set cblabel "Score"
18 unset cbtics
19
20 set xrange [-0.5:4.5]
21 set yrange [-0.5:4.5]
22
23 set view map
24 splot '-' matrix with image
25 5 4 3 1 0
26 2 2 0 0 1
27 0 0 0 1 0
28 0 0 0 2 3
29 0 1 2 4 3
30 e
31 e
32
33 pause -1 "Hit return to continue"
34
35 set title "Heat Map generated by 'plot' from a stream of XYZ values"\
36          ."\nNB: Rows must be separated by blank lines!"
37
38 plot '-' using 2:1:3 with image
39 0 0 5
40 0 1 4
41 0 2 3
42 0 3 1
43 0 4 0
44
45 1 0 2
46 1 1 2
47 1 2 0
48 1 3 0
49 1 4 1
50
51 2 0 0
52 2 1 0
53 2 2 0
54 2 3 1
55 2 4 0
56
57 3 0 0
58 3 1 0
59 3 2 0
60 3 3 2
61 3 4 3
62
63 4 0 0
64 4 1 1
65 4 2 2
66 4 3 4
67 4 4 3
68 e
69
70 pause -1 "Hit return to continue"
71
72 reset