Initial release of Maemo 5 port of gnuplot
[gnuplot] / demo / histograms2.dem
1 #
2 # Example of using histogram modes
3 #
4 reset
5 set title "US immigration from Europe by decade"
6 set datafile missing "-"
7 set xtics nomirror rotate by -45
8 #
9 # 'newhistogram' keyword to plot
10 #
11 set title "Default Histogram Colouring"
12 set key under
13 set key invert
14 set key autotitle columnhead
15 set style data histogram
16 set style histogram clustered gap 1 title offset 2,0.25
17 set style fill solid noborder
18 set boxwidth 0.95
19 unset xtics
20 set xtics rotate by -45
21 set xlabel "Immigration from different regions" offset 0,-3
22 set ytics
23 set grid y
24 set auto y
25 set bmargin 10
26 #
27 plot \
28 newhistogram "Northern Europe", \
29 'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
30 newhistogram "Southern Europe", \
31 '' u 9:xtic(1), '' u 17, '' u 22, \
32 newhistogram "British Isles", \
33 '' u 10:xtic(1), '' u 21
34 #
35 pause -1 "Same plot using explicit histogram start colors"
36 set title "Explicit start color in 'newhistogram' command"
37 plot \
38 newhistogram "Northern Europe" lt 4, \
39 'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
40 newhistogram "Southern Europe" lt 4, \
41 '' u 9:xtic(1), '' u 17, '' u 22, \
42 newhistogram "British Isles" lt 4, \
43 '' u 10:xtic(1), '' u 21
44 #
45 #
46 pause -1 "Same plot using explicit histogram start pattern"
47 set title "Explicit start pattern in 'newhistogram' command"
48 set style fill pattern 1 border -1
49 plot \
50 newhistogram "Northern Europe" fs pattern 1, \
51 'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
52 newhistogram "Southern Europe" fs pattern 1, \
53 '' u 9:xtic(1), '' u 17, '' u 22, \
54 newhistogram "British Isles" fs pattern 1, \
55 '' u 10:xtic(1), '' u 21
56 #
57 #
58 pause -1 "Same plot with both explicit color and pattern"
59 set title "Explicit start pattern and linetype"
60 set style fill pattern 1 border -1
61 plot \
62 newhistogram "Northern Europe" lt 2 fs pattern 1, \
63 'immigration.dat' using 6:xtic(1), '' u 13, '' u 14, \
64 newhistogram "Southern Europe" lt 2 fs pattern 1, \
65 '' u 9:xtic(1), '' u 17, '' u 22, \
66 newhistogram "British Isles" lt 2 fs pattern 1, \
67 '' u 10:xtic(1), '' u 21
68 #
69 #
70 pause -1