%% Rotate Compass Plot
% Rotate a compass plot so that 0 degrees points up by using the view function.
% To do this, create a compass plot using polar coordinates. Convert the polar coordinates to Cartesian coordinates by using the pol2cart function, and then plot the converted coordinates.

th = linspace(0,3*pi/2,10);
r = linspace(5,20,10);
[u,v] = pol2cart(th,r);
compass(u,v)

%
% Note that 0 degrees points to the right. Rotate the theta-axis 90 degrees in a counterclockwise direction by calling view and specifying the first argument as -90. Maintain the 2-D view by specifying the second argument as 90.

view(-90,90)

% Note that 0 degrees now points up.
% Copyright 2020 The MathWorks, Inc.