WIND ROSE DOCUMENTATION
3
TABLE OF CONTENTS
DATA .............................................................................................................................................. 4
NOTES ............................................................................................................................................ 5
SIMPLE USAGE ............................................................................................................................... 6
REFERENCE ANGLES - 'AngleNorth' and 'AngleEast' ...................................................................... 7
FREQUENCY LABELS - 'FreqLabelAngle' ......................................................................................... 9
NUMBER OF DIRECTIONS - 'nDirections' ..................................................................................... 11
BIN ALIGNMENT - 'CenteredIn0' .................................................................................................. 13
SPEED/INTENSITY RANGES NUMBER - 'nSpeeds' ......................................................................... 14
SPEED/INTENSITY RANGES VALUES - 'vWinds' ............................................................................. 15
ROUND MAXIMUM SPEED/INTENSITY - 'SpeedRound' ................................................................ 16
MAXIMUM FREQUENCY - 'MaxFrequency' .................................................................................. 17
FREQUENCY/CIRCULAR GRID LINES - 'nFreq' ............................................................................... 18
RADIAL GRID NUMBER OF DIVISIONS - 'radialGridNumber' ........................................................ 19
ROUND MAXIMUM FREQUENCY VALUE - 'FreqRound' ............................................................... 20
LOWEST SPEED BIN OUTSIDE - 'inverse' ...................................................................................... 21
TITLE, LEGEND LABEL AND LEGEND MAGNITUDE - 'TitleString', 'LabLegend', 'LegendVariable' . 22
NEGATIVE AND ZERO VALUES CONSIDERATION - 'zeroAndNegative' .......................................... 23
MINIMUM RADIUS - 'min_radius' ................................................................................................ 24
COLORMAP - 'cMap' .................................................................................................................... 26
COLORS - 'colors' + 'nSpeeds' or 'vWinds' .................................................................................... 29
LEGEND - 'LegendType' ................................................................................................................ 32
FIGURE SIZE - 'width' and 'height' ................................................................................................ 33
SCALE FACTOR - 'scalefactor' ....................................................................................................... 34
FIGURE TOOLBARS - 'menubar' and 'toolbar' .............................................................................. 35
FIGURE, TEXT AND GRID COLORS - 'figColor', 'textColor', 'gridColor' .......................................... 36
AXIS LABELS - 'labels' ................................................................................................................... 37
GRID LINE STYLES - 'gridStyle', 'gridColor', 'gridWidth', 'gridalpha' .............................................. 40
SUBPLOT - 'axes' .......................................................................................................................... 42
TEXT FONT FACE - 'textfontname', 'titlefontname', 'legendfontname'........................................ 44
TITLE FONT WEIGHT - 'titlefontweight' ........................................................................................ 45
PLOT WINDROSES IN CURRENT AXIS GIVEN X,Y COORDINATES - 'X','Y' ....................................... 46
PLOT EXTRA STUFF ON A EXISTING WINDROSE ........................................................................... 48
OUTPUTS ..................................................................................................................................... 49
AUTHOR ....................................................................................................................................... 50
WIND ROSE DOCUMENTATION
4
DATA
We start from some simple data, which we want to be represented in a wind rose. These data
could come from data measurement (temporal series, data collection, etc.).
I have created the function WindRandomDistrib to generate a random distribution with any
number of elements (8760 in this case) and a maximum wind speed (21.15 in this case).
clc; clear; close all;
rng(31081987);
[spd, dir] = WindRandomDistrib(8760, 21.15);
WIND ROSE DOCUMENTATION
5
NOTES
This function can be called with many arguments at the same time. The obligatory input
arguments are the wind directions and wind speeds (two different vectors).
The following examples have been created in order to show the effect of a particular command,
but all of them can be combined in the function call, within a structure, a cell array or the
common call.
It is important to mention that the properties can be called in lowercase, UPPERCASE or
mixedCASE. In case of repeating properties, the last value will be used for the function.
The following three samples show the different ways of calling the function, giving the same
result.
a) With options in a cell array (the easiest if you have to call several times with same fixed
options):
Options = {'anglenorth', 0, 'angleeast', 90, 'labels', {'N (0°)', 'E (90°)', 'S (180°)',
'W (270°)'}, 'freqlabelangle', 45};
[figure_handle, count, speeds, directions, Table] = WindRose(dir, spd, Options);
% Now we want to add extra options for the following function call
Options1 = [Options,{'axes',gca,'legendtype',2}];
[figure_handle, count, speeds, directions, Table] = WindRose(dir, spd, Options1);
b) With options in a structure (the easiest for changing only one parameter between calls):
Options.AngleNorth = 0;
Options.AngleEast = 90;
Options.Labels = {'N (0°)', 'E (90°)', 'S (180°)', 'W (270°)'};
Options.FreqLabelAngle = 45;
[figure_handle, count, speeds, directions, Table] = WindRose(dir, spd, Options);
% Change only one parameter for new call
Options.FreqLabelAngle = 30;
[figure_handle, count, speeds, directions, Table] = WindRose(dir, spd, Options);
c) Usual Matlab function calling (specify everything with every function call):
[figure_handle, count, speeds, directions, Table] = WindRose(dir, spd, 'anglenorth', 0,
'angleeast', 90, 'labels', {'N (0°)', 'E (90°)', 'S (180°)', 'W (270°)'},
'freqlabelangle', 45);