File: windrose.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (61 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Wind rose created using plot style "sectors"
#
set title "Wind rose (polar coordinate histogram using sectors)"

$data <<EOD
# DIRECTION INDEX COUNT
N    1  10
NNE  2  15
NE   3  21
ENE  4  24
E    5  19
ESE  6  12
SE   7   8
SSE  8   4
S    9   2
SSW 10   4
SW  11   7
WSW 12  10
W   13  11
WNW 14   9
NW  15   5
NNW 16   7
EOD

unset polar
stats $data using 2:3 nooutput

set polar
set angle degrees
set theta top cw

set xrange [-0.2:0.2]
set yrange [-0.2:0.2]
set size ratio -1
set title offset 0,-2

unset border
unset key
unset raxis
unset tics
set margins -1,-1,0,1

roff = 0.01
set grid polar lt -1 lw .5
set rtics roff, .05, .20 format ""
set style fill solid 0.5 border lc bgnd

set obj 1 circle at polar 0,0 radius roff fs solid fc bgnd
set style textbox opaque noborder margin 0.5, 0.5
set label 1 center at polar   0, .17 "N"
set label 2 center at polar  90, .17 "E"
set label 3 center at polar 180, .17 "S"
set label 4 center at polar 270, .17 "W"

array dummy[1]
plot $data using (22.5*($2-1-0.5)):(roff):(22.5):($3/STATS_sum_y) with sectors fc rgb "blue", \
     for [k=5:15:5] dummy using (125):(roff+k/100.0):(sprintf("%d%%",k)) with labels boxed offset 0,-0.75 

pause -1 "<cr> to continue"
reset