#!/usr/bin/gnuplot
unset border
unset ytics
unset xtics
set terminal png
set size square
set polar
set angles degrees
set xrange[-40:40]
set yrange[-40:40]
set grid polar 45
# legend
set key
set xtics axis 0,5,40
set title "Wind last hour km/h"
set label "N" at 0.0,40.0 center
set label "O" at 40.0,0.0 center
set label "S" at 0.0,-40.0 center
set label "W" at -40.0,0.0 center
set label "NO" at 40*sin(45), 40*cos(45) center
set label "SO" at 40*sin(135), 40*cos(135) center
set label "SW" at 40*sin(225), 40*cos(225) center
set label "NW" at 40*sin(315), 40*cos(315) center
# gnuplot starts polar graphs at east and counts counterclockwise
# but we want to start at north and count clockwise
# therefore we label the graph to look like we want and recalculate the data
# by adding 90° and using negative values: (-($1)+90)
set datafile separator "|"
plot \
"w.dat" \
using (-($1)+90):2 with points linecolor rgb "green" pointtype 7 title "speed", \
"" \
using (-($1)+90):3 with points linecolor rgb "red" pointtype 5 title "gusts"