Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

polaraxes

Create polar axes

Syntax

pax = polaraxes
pax = polaraxes(Name,Value)
pax = polaraxes(parent,___)
polaraxes(pax_in)

Description

example

pax = polaraxes creates the default polar axes in the current figure and returns the PolarAxes object created. Use pax to query and set properties of the PolarAxes object. For a list of properties, see PolarAxes Properties.

pax = polaraxes(Name,Value) specifies properties for the PolarAxes object using one or more name-value pair arguments, for example, 'ThetaDir','clockwise'.

pax = polaraxes(parent,___) creates the polar axes in the figure, uipanel, or uitab specified by parent, instead of in the current figure. Use this option with any of the input argument combinations in the previous syntaxes.

example

polaraxes(pax_in) makes the PolarAxes object pax_in the current axes.

Examples

collapse all

Create a new figure with polar axes and assign the polar axes object to pax. Add a plot to the axes. Then, use pax to modify axes properties.

figure
pax = polaraxes;
theta = 0:0.01:2*pi;
rho = sin(2*theta).*cos(2*theta);
polarplot(theta,rho)

pax.ThetaDir = 'clockwise';
pax.FontSize = 12;

Create a figure with polar axes and assign the polar axes object to pax. Then, ensure pax is the current axes before calling the polarplot function.

figure
pax = polaraxes;

polaraxes(pax)
polarplot(1:10)

Input Arguments

collapse all

Parent container, specified as a figure, uipanel, or uitab object.

Polar axes to make current, specified as a PolarAxes object.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'ThetaZeroLocation','top','ThetaDir','clockwise'

The properties listed here are only a subset. For a complete list, see PolarAxes Properties. Some graphics functions reset axes properties when plotting. To avoid graphics functions from overriding the property values, set axes properties after plotting.

collapse all

Units for angle values, specified as one of these values:

  • 'degrees' — Label the angles in degrees, and interpret the ThetaLim, ThetaTick, and RAxisLocation property values in degrees. When you switch the units from radians to degrees, MATLAB® converts the radian values in those three properties to the equivalent degree values.

  • 'radians' — Label the angles in radians, and interpret the ThetaLim, ThetaTick, and RAxisLocation property values in radians. When you switch the units from degrees to radians, MATLAB converts the degree values in those three properties to the equivalent radian values.

Example: ax.ThetaAxisUnits = 'radians';

Location of the zero reference axis, specified as one of the values in this table.

ValueResult
'right'

'top'

'left'

'bottom'

Example: ax.ThetaZeroLocation = 'left';

Direction of increasing angles, specified as one of the values in this table.

ValueResult
'counterclockwise'

Angles increase in a counterclockwise direction.

'clockwise'

Angles increase in a clockwise direction.

Example: ax.ThetaDir = 'clockwise';

Minimum and maximum angle values, specified as a two-element vector of the form [thmin thmax]. If the difference between the values is less than 360 degrees, then the theta-axis is a partial circle.

MATLAB interprets the values in units determined by the ThetaAxisUnits property.

Example: ax.ThetaLim = [0 180];

Angles at which to display lines extending from the origin, specified as a vector of increasing values. MATLAB labels the lines with the appropriate angle values, unless you specify different labels using the ThetaTickLabel property.

MATLAB interprets the values in units determined by the ThetaAxisUnits property.

Example: ax.ThetaTick = [0 90 180 270];

Color of grid lines, tick marks, and tick labels for the theta-axis, specified as an RGB triplet or one of the colors listed in the table.

Note

If you specify the GridColor property, then the grid lines use the color in the GridColor property instead. See GridColorMode for more information.

For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7]. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.

OptionDescriptionEquivalent RGB Triplet
'red' or 'r'Red[1 0 0]
'green' or 'g'Green[0 1 0]
'blue' or 'b'Blue[0 0 1]
'yellow' or 'y'Yellow[1 1 0]
'magenta' or 'm'Magenta[1 0 1]
'cyan' or 'c'Cyan[0 1 1]
'white' or 'w'White[1 1 1]
'black' or 'k'Black[0 0 0]
'none'No colorNot applicable

For example, ax.ThetaColor = 'r' changes the color to red.

Location of the r-axis, specified a scalar angle value. MATLAB interprets the values in units determined by the ThetaAxisUnits property.

Example: ax.RAxisLocation = 90;

Direction of increasing values along the r-axis, specified as one of these values:

  • 'normal' — Values increase outward from the center of the chart. The radius at the origin corresponds to the minimum value stored in the RLim property (typically 0).

  • 'reverse' — Values decrease outward from the center of the chart. The radius at the origin corresponds to the maximum value stored in the RLim property.

Example: ax.RDir = 'reverse';

Minimum and maximum radius limits, specified as a two-element vector of the form [rmin rmax], where rmax is a numeric value greater than rmin. You can specify both limits, or specify one limit and let the axes automatically calculate the other.

  • To automatically set the minimum limit to the minimum data value, specify the first element as -inf, for example, [-inf 0].

  • To automatically set the maximum limit to the maximum data value, specify the second element as inf, for example, [0 inf].

Alternatively, use the rlim function to set the limits.

Example: ax.RLim = [0 6];

Radius values at which to display circular lines, specified as a vector of increasing values. MATLAB labels the lines with the appropriate radius values unless you specify different labels using the RTickLabel property.

Example: ax.RTick = [0 2 4 6];

Color of r-axis grid lines, tick marks, and tick labels, specified as an RGB triplet or one of the color options listed in the table.

Note

If you specify the GridColor property, then the grid lines use the color in the GridColor property instead. See GridColorMode for more information.

For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range [0,1]; for example, [0.4 0.6 0.7]. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.

OptionDescriptionEquivalent RGB Triplet
'red' or 'r'Red[1 0 0]
'green' or 'g'Green[0 1 0]
'blue' or 'b'Blue[0 0 1]
'yellow' or 'y'Yellow[1 1 0]
'magenta' or 'm'Magenta[1 0 1]
'cyan' or 'c'Cyan[0 1 1]
'white' or 'w'White[1 1 1]
'black' or 'k'Black[0 0 0]
'none'No colorNot applicable

For example, ax.RColor = 'r' changes the color to red.

Introduced in R2016a

Was this topic helpful?