How can I create a rose plot of relative frequency in MATLAB 7.7 (R2008b)?

3 views (last 30 days)
I would like create a rose plot with relative frequencies (percentages) rather than absolute counts.
I would also like to:
1) Shade the regions
2) Locate zero degrees at North
3) Add the percentage symbol to the radial labels
4) Align the radial labels horizontally
5) Add North, South, East, and West labels

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 2 Jul 2012
To create rose plots of relative frequencies in MATLAB 7.7 (R2008b), please try the following example code, which first creates a regular rose plot and grabs the output frequencies. Then, it manipulates those frequencies into relative frequencies, before passing them into POLAR for the final plot. This creates a basic, relative plot:
theta = 2*pi*rand(1,50);
nbins = 20;
[tout,rout] = rose(theta,nbins);
relativefreq = rout/length(theta);
polar(tout,relativefreq)
For the more advanced features, download the attached file, and place it in the following directory (where $MATLABROOT is the location of your MATLAB installation as returned by the MATLABROOT function):
$MATLABROOT\toolbox\matlab\specgraph\
The code below will create a filled histogram with the extra features; you can change the color of the patch by editing line 91 of rose2Relative.m.
theta = 2*pi*rand(1,50);
rose2Relative(theta);

More Answers (0)

Categories

Find more on Polar Plots in Help Center and File Exchange

Products


Release

R2008b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!