Contents Previous Next Subchapters Current Chapters-> errorbar garrow ghist gbar bar gstair polar smith fcplot fdplot Parent Chapters-> Omatrix6 graphics specialplots polar Search Tools-> contents reference index search

Plotting In Polar Coordinates
 Syntax `polar(`r`, `theta`, `rmax`, `rmajor`, `tmajor`, `style`, `color`)` See Also smith , atan2 , log , smith

Description
Draws a polar coordinate plot of radius versus angle in viewport number 0 of the current graphics window. The initial contents of the viewport are erased, and it is the current viewport when the plot is completed. ``` ```The integer, real, or double-precision matrix r specifies the radius value for each point. The integer, real, or double-precision matrix theta specifies the angle in degrees for each point and has the same dimensions as r. The j-th column of r and theta is plotted as a separate curve with its own color. The integer, real, or double-precision scalar rmax specifies the maximum radius value for the plot. ``` ```If rmajor is an integer scalar, it specifies the number of major divisions in the radius direction. In this case, the current format for the matrices with the same type as rmax is used to label the radius values. For example, if rmax is real and the current format for real is "f10.3", the radius labels will be in fixed point notation with three places behind the decimal point. ``` ```If rmajor is a character matrix, the number of rows in rmajor specifies the number of major divisions in the radius direction and the value of each row specifies the label for the corresponding radius value. To be specific, the i-th row corresponds to a radius value of `i rmax / nr` where `nr` is the row dimension of rmajor. The last label in rmajor is not currently used but may be used in future versions of `polar`. ``` ```If tmajor is an integer scalar, it specifies the number of major divisions in the radius direction. In this case, the current format for the matrices with the same type as theta is used to label the angle values. For example, if theta is real and the current format for real is "f10.3", the angle labels will be in fixed point notation with three places behind the decimal point. ``` ```If tmajor is a character matrix, the number of rows in tmajor specifies the number of major divisions in the angle direction and the value of each row specifies the label for the corresponding angle value. To be specific, the i-th row corresponds to an angle value of `(i-1) 360 / nr` where `nr` is the row dimension of rmajor. ``` ```The character row vector style specifies the style for plotting the curve and is one of the following: "solid", "dotted", "dashed", "triangle", "star", "square", "plus", "diamond", "dot", or "cross". ``` ```The character matrix color specifies the color for plotting each of the curves. It must have the same number of rows as r and theta have columns. The color in the i-th row of color is used to plot the i-th column of r and theta. Each row of color must be one of the following: "black", "maroon", "green", "olive", "navy", "purple", "teal", "gray", "silver", "red", "lime", "yellow", "blue", "fuschia" or "aqua". ``` ```The aspect ratio for the current graphic window is set to 1. If you change this, your polar plot will not be square.

Example ```      r       = 1. : 1. : 100.      Theta   = 360. * [r, -r] / 100.      R       = [r, r]      rmax    = 100      rmajor  = 4      tmajor  = 12      style   = "solid"      color   = {"red", "blue"}      polar(R, Theta, rmax, rmajor, tmajor, style, color) ``` returns the following plot: ``` ```