polar

Creates a line plot in polar coordinates.

Syntax

h = polar(theta, rho)

h = polar(complex)

h = polar(..., fmt)

h = polar(hAxes, ...)

Inputs

theta, rho
Range of theta (angle) and rho (radius)
Type: double | integer
Dimension: string | vector | matrix
complex
Complex matrix which real part is used as theta data and imaginary part is used as rho data.
Type: complex
Dimension: matrix
fmt
Formatting string for the curve. It can be any combination of the following strings:
  1. line style: '-', '-.', ':', '--', '-:'.
  2. line color: 'r', 'g', 'b', 'c', 'y', 'm', 'w', 'b'.
  3. marker style: 's', 'o', 'd', 'x', 'v', '^', '+', '*', '.'.
Type: string
Dimension: scalar
hAxes
Axis handle.
Type: double
Dimension: scalar

Outputs

h
Handle of the polar plot line graphics object.

Example

Polar plot example.

clf;
t = linspace(0,2*pi,1000);
r = cos(t+2*t).*cos(t);
polar(t,r)
Figure 1. Polar plot


Comments

If there is no axis, one is created first. If a complex matrix (denoted by x) is given, the real part is used for theta and the imaginary part is used for rho.