matlabrose-plot

Rotating and reflecting Polarhistogram in MATLAB


The default orientation for polarhistogram plots in MATLAB is with 90degrees at the top and 270degrees at the bottom. For example:

Example of a polarhistogram in MATLAB

I would like to however orientate the plot such that north (0degrees) is at the top, 90degrees is on the right, 180degrees is on the bottom and 270 degrees is on the left i.e. like a normal compass. With Rose (now outdated?) this would have been possible with:

set(gca,'View',[-90 90],'YDir','reverse');

However, this produces errors with Polarhistogram:

Error using matlab.graphics.axis.PolarAxes/set
PolarAxes View property must be [0 90].
Error in untitled5 (line 77)
set(gca,'View',[-90 90],'YDir','reverse');

How can I reorientate polarhiostogram?


Solution

  • All modifications can be done within the PolarAxes class

    set(gca,'ThetaZeroLocation','top',...
            'ThetaDir','counterclockwise');