polaraxes - Create polar axes - MATLAB (original) (raw)

Syntax

Description

polaraxes creates the default polar axes in the current figure.

example

polaraxes([Name,Value](#namevaluepairarguments)) specifies properties for the PolarAxes object using one or more name-value pair arguments, for example,'ThetaDir','clockwise'. For a list of properties, seePolarAxes Properties.

polaraxes([parent](#buyrm5i%5Fsep%5Fmw%5F58c53d12-c3c1-4fe8-b606-f6a109982a64),___) creates the polar axes in the figure, panel, or tab specified byparent, instead of in the current figure. Use this option alone or with name-value pair arguments.

`pax` = polaraxes(___)returns the PolarAxes object created. Usepax to query and set properties of the PolarAxes object after it is created. For a list of properties, see PolarAxes Properties.

polaraxes([pax_in](#buyrm5i-pax%5Fin)) makes the PolarAxes object pax_in the current axes.

example

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:2pi; rho = sin(2theta).cos(2theta); polarplot(theta,rho)

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

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type line.

Before R2022a, polar axes do not include degree symbols by default. To add them, get the polar axes using pax = gca. Then modify the tick labels using pax.ThetaTickLabel = string(pax.ThetaTickLabel) + char(176).

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)

Figure contains an axes object with type polaraxes. The polaraxes object contains an object of type line.

Input Arguments

collapse all

Parent container, specified as a Figure, Panel,Tab, TiledChartLayout, or GridLayout object.

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

Name-Value Arguments

collapse all

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

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.

Version History

Introduced in R2016a

expand all

Polar axes now display tick values in degrees with degree symbols when theThetaAxisUnits property is set to"degrees".

This change clarifies which units are being used for the theta tick values. You can use the ThetaAxisUnits property to display the tick values in degrees or radians. To remove the degree symbols, change the tick label format for the_theta_-axis:

pax = polaraxes; pax.ThetaAxis.TickLabelFormat = "%g";