Skip to Main Content Skip to Search
Product Documentation

polar - Polar coordinate plot

Example of polar function output

Alternatives

To graph selected variables, use the Plot Selector in the Workspace Browser, or use the Figure Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor. For details, see Plotting Tools — Interactive Plotting in the MATLAB Graphics documentation and Creating Graphics from the Workspace Browser in the MATLAB Desktop Tools documentation.

Syntax

polar(theta,rho)
polar(theta,rho,LineSpec)
polar(axes_handle,...)
h = polar(...)

Description

The polar function accepts polar coordinates, plots them in a Cartesian plane, and draws the polar grid on the plane.

polar(theta,rho) creates a polar coordinate plot of the angle theta versus the radius rho. theta is the angle from the x-axis to the radius vector specified in radians; rho is the length of the radius vector specified in dataspace units.

polar(theta,rho,LineSpec) LineSpec specifies the line type, plot symbol, and color for the lines drawn in the polar plot.

polar(axes_handle,...) plots into the axes with the handle axes_handle instead of into the current axes (gca).

h = polar(...) returns the handle of a line object in h.

Tips

Negative r values reflect through the origin, rotating by pi (since (theta,r) transforms to (r*cos(theta), r*sin(theta))). If you want different behavior, you can manipulate r prior to plotting. For example, you can make r equal to max(0,r) or abs(r).

Examples

Create a simple polar plot using a dashed red line:

figure
t = 0:.01:2*pi;
polar(t,sin(2*t).*cos(2*t),'--r')

See Also

cart2pol | compass | LineSpec | plot | pol2cart | rose

  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS