www.gusucode.com > graphics 案例源码程序 matlab代码 > graphics/PolarAxesGridLinesAndLabelsExample.m

    %% Polar Axes Grid Lines and Labels
% This example shows how to plot a line in polar coordinates, label the
% angles in radians, and modify the grid line locations.

%% Create Polar Plot
% Plot a line in polar coordinates. 
theta = linspace(0,4*pi);
rho = 2*theta;
polarplot(theta,rho);

%% Theta-Axis Units
% Use |gca| to access the polar axes and its properties. Label the angles
% in radians instead of degrees by changing the units.
pax = gca;
pax.ThetaAxisUnits = 'radians';

%% Theta-Axis Grid Lines
% Specify the theta values at which to display grid lines. Specify the
% values in radians since the |ThetaAxisUnits| property is set to radians.

pax.ThetaTick = 0:pi/4:2*pi;

%% R-Axis Limits
% Change the _r_-axis limits.

pax.RLim = [-5 25];

%% R-Axis Grid Lines
% Specify the radius values at which to display grid lines.

pax.RTick = -5:10:25;