Graphics | ![]() ![]() |
Compass Plots
The compass
function shows vectors emanating from the origin of a graph. The function takes Cartesian coordinates and plots them on a circular grid.
Example - Compass Plot of Wind Direction and Speed
This example shows a compass plot indicating the wind direction and strength during a 12-hour period. Two vectors define the wind direction and strength.
wdir = [45 90 90 45 360 335 360 270 335 270 335 335]; knots = [6 6 8 6 3 9 6 8 9 10 14 12];
Convert the wind direction, given as angles, into radians before converting the wind direction into Cartesian coordinates.
rdir = wdir * pi/180; [x,y] = pol2cart(rdir,knots); compass(x,y)
Create text to annotate the graph.
desc = {'Wind Direction and Strength at', 'Logan Airport for ', 'Nov. 3 at 1800 through', 'Nov. 4 at 0600'}; text(-28,15,desc)
![]() | Direction and Velocity Vector Graphs | Feather Plots | ![]() |