PolarAxes - Polar axes appearance and behavior - MATLAB (original) (raw)

PolarAxes Properties

Polar axes appearance and behavior

PolarAxes properties control the appearance and behavior of a PolarAxes object. By changing property values, you can modify certain aspects of the polar axes. Set axes properties after plotting since some graphics functions reset axes properties.

Some graphics functions create polar axes when plotting. Use gca to access the newly created axes. To create empty polar axes, use thepolaraxes function.

polarplot([0 pi/2 pi],[1 2 3]) ax = gca; d = ax.ThetaDir; ax.ThetaDir = 'clockwise';

Font

expand all

Font size, specified as a scalar numeric value. The font size affects the title and tick labels. It also affects any legends or colorbars associated with the axes. The default font size depends on the specific operating system and locale. By default, the font size is measured in points. To change the units, set the FontUnits property.

MATLAB® automatically scales some of the text to a percentage of the axes font size.

Example: ax.FontSize = 12

Selection mode for the font size, specified as one of these values:

Scale factor for the title font size, specified as a numeric value greater than 0. The scale factor is applied to the value of the FontSize property to determine the font size for the title.

Subtitle character thickness, specified as one of these values:

Ticks

expand all

Selection mode for the radius tick values, specified as one of these values:

Example: ax.RTickMode = 'auto'

Radius tick labels, specified as a cell array of character vectors, string array, or categorical array. If you do not want tick labels to show, then specify an empty cell array {}. If you do not specify enough labels for all the ticks values, then the labels repeat.

Tick labels support TeX and LaTeX markup. See the TickLabelInterpreter property for more information.

If you specify this property as a categorical array, MATLAB uses the values in the array, not the categories.

Example: ax.RTickLabel = {'one','two','three','four'};

Alternatively, use the rticklabels function.

Selection mode for the RTickLabel property value, specified as one of these values:

Selection mode for the ThetaTick property value, specified as one of these values:

Labels for angle lines, specified as a cell array of character vectors, string array, or categorical array.

If you do not specify enough labels for all the lines, then the labels repeat. Labels support TeX and LaTeX markup. See the TickLabelInterpreter property for more information.

If you specify this property as a categorical array, MATLAB uses the values in the array, not the categories.

Example: ax.ThetaTickLabel = {'right','top','left','bottom'};

Alternatively, specify the values using the thetaticklabels function.

Selection mode for the ThetaTickLabel property value, specified as one of these values:

Rotation of _r_-axis tick labels, specified as a scalar value in degrees. Positive values give counterclockwise rotation. Negative values give clockwise rotation.

Example: ax.RTickLabelRotation = 45;

Alternatively, use the rtickangle function.

Selection mode for the _r_-axis tick label rotation, specified as one of these values:

Minor tick marks along _r_-axis, specified as'on' or 'off', or as numeric or logical 1 (true) or0 (false). A value of'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Example: ax.RMinorTick = 'on';

Minor tick marks between angle lines, specified as 'on' or 'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Tick mark direction, specified as one of these values:

Tick mark length, specified as a two-element vector. The first element determines the tick length. The second element is ignored.

Example: ax.TickLength = [0.02 0];

Rulers

expand all

Selection mode for the RLim property value, specified as one of these values:

Selection mode for the ThetaLim property value, specified as one of these values:

Component that controls the appearance and behavior of the_r_-axis, returned as a ruler object. When MATLAB creates polar axes, it automatically creates a ruler for the_r_-axis. Modify the appearance and behavior of this axis by accessing the associated ruler and setting ruler properties. For a list of options, see NumericRuler Properties.

For example, change the color of the _r_-axis to red.

ax = polaraxes; ax.RAxis.Color = 'r';

Use the RAxis properties to access the ruler objects and set ruler properties. If you want to set polar axes properties, set them directly on the PolarAxes object.

Component that controls the appearance and behavior of the theta-axis, returned as a ruler object. When MATLAB creates polar axes, it automatically creates a numeric ruler for the _theta_-axis. Modify the appearance and behavior of this axis by accessing the associated ruler and setting ruler properties. For a list of options, see NumericRuler Properties.

For example, change the color of the _theta_-axis to red.

ax = polaraxes; ax.ThetaAxis.Color = 'r';

Use the ThetaAxis property to access the ruler object and set ruler properties. If you want to set polar axes properties, set them directly on the PolarAxes object.

Selection mode for the RAxisLocation property value, specified as one of these values:

Property for setting _r_-axis grid color, specified'auto' or 'manual'. The mode value only affects the _r_-axis grid color. The_r_-axis tick labels always use theRColor value, regardless of the mode.

The _r_-axis grid color depends on both theRColorMode property and theGridColorMode property, as shown here.

RColorMode GridColorMode r-Axis Grid Color
'auto' 'auto' GridColor property
'manual' GridColor property
'manual' 'auto' RColor property
'manual' GridColor property

The _r_-axis minor grid color depends on both theRColorMode property and theMinorGridColorMode property, as shown here.

RColorMode MinorGridColorMode r-Axis Minor Grid Color
'auto' 'auto' MinorGridColor property
'manual' MinorGridColor property
'manual' 'auto' RColor property
'manual' MinorGridColor property

Property for setting _theta_-axis grid color, specified'auto' or 'manual'. The mode value only affects the _theta_-axis grid color. The_theta_-axis line, tick marks, and labels always use the ThetaColor value, regardless of the mode.

The _theta_-axis grid color depends on both theThetaColorMode property and theGridColorMode property, as shown here.

ThetaColorMode GridColorMode theta-Axis Grid Color
'auto' 'auto' GridColor property
'manual' GridColor property
'manual' 'auto' ThetaColor property
'manual' GridColor property

The _theta_-axis minor grid color depends on both theThetaColorMode property and theMinorGridColorMode property, as shown here.

ThetaColorMode MinorGridColorMode theta-Axis Minor Grid Color
'auto' 'auto' MinorGridColor property
'manual' MinorGridColor property
'manual' 'auto' ThetaColor property
'manual' MinorGridColor property

Grid Lines

expand all

Display of _r_-axis grid lines, specified as'on' or 'off', or as numeric or logical 1 (true) or0 (false). A value of'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Value Result
'on' Display the lines. Polar axes displaying the r-axis grid lines. The grid lines are concentric circles. Each circle corresponds to an r-axis tick value.
'off' Do not display the lines. Polar axes without the r-axis grid lines.

Example: ax.RGrid = 'off';

Display of _theta_-axis grid lines, specified as'on' or 'off', or as numeric or logical 1 (true) or0 (false). A value of'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Value Result
'on' Display the lines. Polar axes displaying the theta-axis grid lines. The grid lines slice through the circle at the different theta angles.
'off' Do not display the lines. Polar axes without the theta-axis grid lines.

Example: ax.ThetaGrid = 'off';

Line style used for grid lines, specified as one of the line styles in this table.

Line Style Description Resulting Line
"-" Solid line Sample of solid line
"--" Dashed line Sample of dashed line
":" Dotted line Sample of dotted line
"-." Dash-dotted line Sample of dash-dotted line, with alternating dashes and dots
"none" No line No line

To display grid lines, use the grid on command or set the ThetaGrid orRGrid property to 'on'.

Example: ax.GridLineStyle = '--';

Color of the grid lines, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name. The actual grid color depends on the values of the GridColorMode,ThetaColorMode, and RColorMode properties. See GridColorMode for more information.

For a custom color, specify an RGB triplet or a hexadecimal color code.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and the hexadecimal color codes.

Color Name Short Name RGB Triplet Hexadecimal Color Code Appearance
"red" "r" [1 0 0] "#FF0000" Sample of the color red
"green" "g" [0 1 0] "#00FF00" Sample of the color green
"blue" "b" [0 0 1] "#0000FF" Sample of the color blue
"cyan" "c" [0 1 1] "#00FFFF" Sample of the color cyan
"magenta" "m" [1 0 1] "#FF00FF" Sample of the color magenta
"yellow" "y" [1 1 0] "#FFFF00" Sample of the color yellow
"black" "k" [0 0 0] "#000000" Sample of the color black
"white" "w" [1 1 1] "#FFFFFF" Sample of the color white
"none" Not applicable Not applicable Not applicable No color

This table lists the default color palettes for plots in the light and dark themes.

Palette Palette Colors
"gem" — Light theme default_Before R2025a: Most plots use these colors by default._ Sample of the "gem" color palette
"glow" — Dark theme default Sample of the "glow" color palette

You can get the RGB triplets and hexadecimal color codes for these palettes using the orderedcolors and rgb2hex functions. For example, get the RGB triplets for the "gem" palette and convert them to hexadecimal color codes.

RGB = orderedcolors("gem"); H = rgb2hex(RGB);

Before R2023b: Get the RGB triplets using RGB = get(groot,"FactoryAxesColorOrder").

Before R2024a: Get the hexadecimal color codes using H = compose("#%02X%02X%02X",round(RGB*255)).

Example: ax.GridColor = [0 0 1]

Example: ax.GridColor = 'blue'

Example: ax.GridColor = '#0000FF'

Property for setting the grid color, specified as one of these values:

Display of _r_-axis minor grid lines, specified as'on' or 'off', or as numeric or logical 1 (true) or0 (false). A value of'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Value Result
'on' Display the lines. Polar axes displaying the r-axis minor grid lines
'off' Do not display the lines. Polar axes without the r-axis minor grid lines

Example: ax.RMinorGrid = 'on';

Display of _theta_-axis minor grid lines, specified as'on' or 'off', or as numeric or logical 1 (true) or0 (false). A value of'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Value Result
'on' Display the lines. Polar axes displaying the theta-axis minor grid lines
'off' Do not display the lines. Polar axes displaying the theta-axis minor grid lines

Example: ax.ThetaMinorGrid = 'on';

Line style used for minor grid lines, specified as one of the line styles in this table.

Line Style Description Resulting Line
"-" Solid line Sample of solid line
"--" Dashed line Sample of dashed line
":" Dotted line Sample of dotted line
"-." Dash-dotted line Sample of dash-dotted line, with alternating dashes and dots
"none" No line No line

To display the grid lines, use the grid minor command or set the ThetaMinorGrid orRMinorGrid property to'on'.

Example: ax.MinorGridLineStyle = '-.';

Color of minor grid lines, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name. The actual grid color depends on the values of the MinorGridColorMode,ThetaColorMode, and RColorMode properties. See MinorGridColorMode for more information.

For a custom color, specify an RGB triplet or a hexadecimal color code.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and the hexadecimal color codes.

Color Name Short Name RGB Triplet Hexadecimal Color Code Appearance
"red" "r" [1 0 0] "#FF0000" Sample of the color red
"green" "g" [0 1 0] "#00FF00" Sample of the color green
"blue" "b" [0 0 1] "#0000FF" Sample of the color blue
"cyan" "c" [0 1 1] "#00FFFF" Sample of the color cyan
"magenta" "m" [1 0 1] "#FF00FF" Sample of the color magenta
"yellow" "y" [1 1 0] "#FFFF00" Sample of the color yellow
"black" "k" [0 0 0] "#000000" Sample of the color black
"white" "w" [1 1 1] "#FFFFFF" Sample of the color white
"none" Not applicable Not applicable Not applicable No color

This table lists the default color palettes for plots in the light and dark themes.

Palette Palette Colors
"gem" — Light theme default_Before R2025a: Most plots use these colors by default._ Sample of the "gem" color palette
"glow" — Dark theme default Sample of the "glow" color palette

You can get the RGB triplets and hexadecimal color codes for these palettes using the orderedcolors and rgb2hex functions. For example, get the RGB triplets for the "gem" palette and convert them to hexadecimal color codes.

RGB = orderedcolors("gem"); H = rgb2hex(RGB);

Before R2023b: Get the RGB triplets using RGB = get(groot,"FactoryAxesColorOrder").

Before R2024a: Get the hexadecimal color codes using H = compose("#%02X%02X%02X",round(RGB*255)).

Example: ax.MinorGridColor = [0 0 1]

Example: ax.MinorGridColor = 'blue'

Example: ax.MinorGridColor = '#0000FF'

Property for setting the minor grid color, specified as one of these values:

Labels

expand all

Text object for the axes title. To add a title, set the String property of the text object. To change the title appearance, such as the font style or color, set other properties. For a complete list, see Text Properties.

ax = gca; ax.Title.String = 'My Title'; ax.Title.FontWeight = 'normal';

Alternatively, use the title function to add a title and control the appearance.

title('My Title','FontWeight','normal')

Note

This text object is not contained in the axes Children property, cannot be returned by findobj, and does not use default values defined for text objects.

Text object for the axes subtitle. To add a subtitle, set the String property of the text object. To change its appearance, such as the font angle, set other properties. For a complete list, see Text Properties.

ax = gca; ax.Subtitle.String = 'An Insightful Subtitle'; ax.Subtitle.FontAngle = 'italic';

Alternatively, use the subtitle function to add a subtitle and control the appearance.

subtitle('An Insightful Subtitle','FontAngle','italic')

Or use the title function, and specify two character vector input arguments and two output arguments. Then set properties on the second text object returned by the function.

[t,s] = title('Clever Title','An Insightful Subtitle'); s.FontAngle = 'italic';

Note

This text object is not contained in the axes Children property, cannot be returned by findobj, and does not use default values defined for text objects.

Title and subtitle horizontal alignment with an invisible box that circumscribes the polar axes, specified as one of the following values:

This property is read-only.

Legend associated with the axes, specified as a legend object. You can use this property to determine if the axes has a legend.

ax = gca; lgd = ax.Legend if ~isempty(lgd) disp('Legend Exists') end

You also can use this property to access properties of an existing legend. For a list of properties, see Legend Properties.

polarplot(1:10) legend({'Line 1'},'FontSize',12) ax = gca; ax.Legend.TextColor = 'red';

Multiple Plots

expand all

Since R2023a

How to cycle through the line styles when there are multiple lines in the axes, specified as one of the values from this table.

The examples in this table were created using the default colors in theColorOrder property and three line styles (["-","-o","--"]) in the LineStyleOrder property.

Value Description Example
"aftercolor" Cycle through the line styles of the LineStyleOrder after the colors of the ColorOrder. Six lines that use the "aftercolor" line style cycling method. Each line is a different color with the same line style.
"beforecolor" Cycle through the line styles of theLineStyleOrder before the colors of theColorOrder. Six lines that use the "beforecolor" line style cycling method. The first three lines use all three line styles with the first color. The last three lines repeat the line styles with the second color.
"withcolor" Cycle through the line styles of theLineStyleOrder with the colors of theColorOrder. Six lines that use the "withcolor" line style cycling method. The first three lines use all three line styles with the first three colors. The last three lines repeat the line styles with the next three colors.

This property is read-only.

SeriesIndex value for the next plot object added to the axes, returned as a whole number greater than or equal to 0. This property is useful when you want to track how the objects cycle through the colors and line styles. This property maintains a count of the objects in the axes that have a numericSeriesIndex property value. MATLAB uses it to assign a SeriesIndex value to each new object. The count starts at 1 when you create the axes, and it increases by 1 for each additional object. Thus, the count is typically n+1, where n is the number of objects in the axes.

If you manually change the ColorOrderIndex orLineStyleOrderIndex property on the axes, the value of theNextSeriesIndex property changes to 0. As a consequence, objects that have a SeriesIndex property no longer update automatically when you change the ColorOrder orLineStyleOrder properties on the axes.

Color and Transparency Maps

expand all

Color map, specified as an m-by-3 array of RGB (red, green, blue) triplets that define m individual colors.

Example: ax.Colormap = [1 0 1; 0 0 1; 1 1 0] sets the color map to three colors: magenta, blue, and yellow.

MATLAB accesses these colors by their row number.

Alternatively, use the colormap function to change the color map.

Scale for color mapping, specified as one of these values:

Color limits for the colormap, specified as a two-element vector of the form [cmin cmax].

If the associated mode property is set to 'auto', then MATLAB chooses the color limits. If you assign a value to this property, then MATLAB sets the mode to 'manual' and does not automatically choose the color limits.

Transparency map, specified as an array of finite alpha values that progress linearly from0 to 1. The size of the array can be_m_-by-1 or 1-by-m. MATLAB accesses alpha values by their index in the array. An alphamap can be any length.

Scale for transparency mapping, specified as one of these values:

Alpha limits for alphamap, specified as a two-element vector of the form[amin amax].

If the associated mode property is set to 'auto', then MATLAB chooses the alpha limits. If you set this property, then MATLAB sets the mode to 'manual' and does not automatically choose the alpha limits.

Box Styling

expand all

Background color, specified as an RGB triplet, a hexadecimal color code, a color name, or a short name.

For a custom color, specify an RGB triplet or a hexadecimal color code.

Alternatively, you can specify some common colors by name. This table lists the named color options, the equivalent RGB triplets, and the hexadecimal color codes.

Color Name Short Name RGB Triplet Hexadecimal Color Code Appearance
"red" "r" [1 0 0] "#FF0000" Sample of the color red
"green" "g" [0 1 0] "#00FF00" Sample of the color green
"blue" "b" [0 0 1] "#0000FF" Sample of the color blue
"cyan" "c" [0 1 1] "#00FFFF" Sample of the color cyan
"magenta" "m" [1 0 1] "#FF00FF" Sample of the color magenta
"yellow" "y" [1 1 0] "#FFFF00" Sample of the color yellow
"black" "k" [0 0 0] "#000000" Sample of the color black
"white" "w" [1 1 1] "#FFFFFF" Sample of the color white
"none" Not applicable Not applicable Not applicable No color

This table lists the default color palettes for plots in the light and dark themes.

Palette Palette Colors
"gem" — Light theme default_Before R2025a: Most plots use these colors by default._ Sample of the "gem" color palette
"glow" — Dark theme default Sample of the "glow" color palette

You can get the RGB triplets and hexadecimal color codes for these palettes using the orderedcolors and rgb2hex functions. For example, get the RGB triplets for the "gem" palette and convert them to hexadecimal color codes.

RGB = orderedcolors("gem"); H = rgb2hex(RGB);

Before R2023b: Get the RGB triplets using RGB = get(groot,"FactoryAxesColorOrder").

Before R2024a: Get the hexadecimal color codes using H = compose("#%02X%02X%02X",round(RGB*255)).

Example: ax.Color = 'none'

Width of circular and angle lines, specified as a scalar value in point units. One point equals 1/72 inch.

Example: ax.LineWidth = 1.5

Outline around the polar axes, specified as 'on' or'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

The difference between the values is most noticeable when the_theta_-axis limits do not span 360 degrees.

Value Result
'on' Display the full outline around the polar axes. Polar axes with the ThetaLim property set to [45 315], which produces a partial circle. Border lines display along the edges at theta= 45 and theta=315.
'off' Do not display the full outline around the polar axes. Polar axes with the ThetaLim property set to [45 315], which produces a partial circle. There are no border lines along the edges at theta= 45 and theta=315.

Example: ax.Box = 'on'

Clipping of objects to the polar axes boundary, specified as'on' or 'off', or as numeric or logical 1 (true) or0 (false). A value of'on' is equivalent to true, and'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

The clipping behavior of an object in the polar axes depends on both theClipping property of the polar axes and theClipping property of the individual object. The property value of the polar axes has these effects:

This table lists the results for different combinations ofClipping property values.

Clipping Property for Axes Object Clipping Property for Individual Object Result
'on' 'on' Individual object is clipped. Others might or might not be.
'on' 'off' Individual object is not clipped. Others might or might not be.
'off' 'on' Individual object and other objects are not clipped.
'off' 'off' Individual object and other objects are not clipped.

Thick lines and markers might display outside the polar axes limits, even if clipping is enabled. If a plot contains markers, then as long as the data point lies within the polar axes, MATLAB draws the entire marker.

Position

expand all

Size and position of polar axes, including the labels and margins, specified as a four-element vector of the form [left bottom width height]. This vector defines the extents of the rectangle that encloses the outer bounds of the polar axes. The left andbottom elements define the distance from the lower-left corner of the figure or uipanel that contains the polar axes to the lower-left corner of the rectangle. The width andheight elements are the rectangle dimensions.

By default, the values are measured in units normalized to the container. To change the units, set the Units property. The default value of [0 0 1 1] includes the whole interior of the container.

Note

Setting this property has no effect when the parent container is aTiledChartLayout object.

Inner size and location, specified as a four-element vector of the form[left bottom width height]. This property is equivalent to the Position property.

Note

Size and location of the polar axes, not including labels or margins, specified as a four-element vector of the form [left bottom width height]. This vector defines the extents of the tightest bounding rectangle that encloses the polar axes. The left and bottom elements define the distance from the lower-left corner of the container to the lower-left corner of the rectangle. The width and height elements are the rectangle dimensions.

By default, the values are measured in units normalized to the container. To change the units, set the Units property.

Example: ax.Position = [0 0 1 1]

Note

This property is read-only.

Margins for the text labels, returned as a four-element vector of the form[left bottom right top]. The elements define the distances between the bounds of the Position property and the extent of the polar axes text labels and title. By default, the values are measured in units normalized to the figure or uipanel that contains the polar axes. To change the units, set theUnits property.

The Position property and theTightInset property define the tightest bounding box that encloses the polar axes and its labels and title.

Position property to hold constant when adding, removing, or changing decorations, specified as one of the following values:

Note

Setting this property has no effect when the parent container is aTiledChartLayout object.

Layout options, specified as a TiledChartLayoutOptions or aGridLayoutOptions object. This property is useful when the axes object is either in a tiled chart layout or a grid layout.

To position the axes within the grid of a tiled chart layout, set theTile and TileSpan properties on theTiledChartLayoutOptions object. For example, consider a 3-by-3 tiled chart layout. The layout has a grid of tiles in the center, and four tiles along the outer edges. In practice, the grid is invisible and the outer tiles do not take up space until you populate them with axes or charts.

Diagram of a 3-by-3 tiled chart layout.

This code places the axes ax in the third tile of the grid.

To make the axes span multiple tiles, specify the TileSpan property as a two-element vector. For example, this axes spans 2 rows and 3 columns of tiles.

ax.Layout.TileSpan = [2 3];

To place the axes in one of the surrounding tiles, specify theTile property as 'north','south', 'east', or 'west'. For example, setting the value to 'east' places the axes in the tile to the right of the grid.

To place the axes into a layout within an app, specify this property as aGridLayoutOptions object. For more information about working with grid layouts in apps, see uigridlayout.

If the axes is not a child of either a tiled chart layout or a grid layout (for example, if it is a child of a figure or panel) then this property is empty and has no effect.

Interactivity

expand all

Since R2024a

Options to customize interaction behavior, specified as aPolarAxesInteractionOptions object. Use the properties of the PolarAxesInteractionOptions object to customize the behavior of interactions with the polar axes. For a complete list of properties, see PolarAxesInteractionOptions Properties.

The options set by the PolarAxesInteractionOptions object apply to these interactions on the associated polar axes:

Example: pax.InteractionOptions.DatatipsPlacementMethod = "interpolate" allows data tips to be placed at locations on the plot that are between data points.

Data exploration toolbar, which is an AxesToolbar object. The toolbar appears at the top-right corner of the axes when you hover over it and includes options for exporting and data tips.

You can customize the toolbar buttons using the axtoolbar and axtoolbarbtn functions.

If you do not want the toolbar to appear when you hover over the axes, set the Visible property of the AxesToolbar object to 'off'.

ax = gca; ax.Toolbar.Visible = 'off';

For more information, see AxesToolbar Properties.

Interactions, specified as a DataTipInteraction object or an empty array. When the value of this property is a DataTipInteraction object, you can display data tips within your chart without selecting any of the axes toolbar buttons.

To remove all interactions from the axes, set this property to an empty array. To temporarily disable the current set of interactions, call thedisableDefaultInteractivity function. You can reenable them by calling the enableDefaultInteractivity function.

Note

The DataTipInteraction object is not returned byfindobj or findall, and it is not copied by copyobj.

For more information about chart interactions, see Control Chart Interactivity.

State of visibility, specified as 'on' or 'off', or as numeric or logical 1 (true) or 0 (false). A value of 'on' is equivalent to true, and 'off' is equivalent to false. Thus, you can use the value of this property as a logical value. The value is stored as an on/off logical value of type matlab.lang.OnOffSwitchState.

Note

When the Visible property is 'off', the axes object is invisible, but child objects such as lines remain visible.

This property is read-only.

Location of mouse pointer, returned as a two element vector of the form[th r]. The elements of the vector indicate the location of the last click within the axes. th is the theta angle in radians, and r is the radius value. Each value is bounded by the following limits:

If the figure has a WindowButtonMotionFcn callback defined, then the value indicates the last location of the pointer. The figure also has a CurrentPoint property.

Callbacks

Callback Execution Control

expand all

This property is read-only.

Parent/Child

expand all

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

Identifiers

expand all

This property is read-only.

Type of graphics object, returned as'polaraxes'.

Object identifier, specified as a character vector or string scalar. You can specify a unique Tag value to serve as an identifier for an object. When you need access to the object elsewhere in your code, you can use the findobj function to search for the object based on the Tag value.

Version History

Introduced before R2006a

expand all

The default ColorOrder, RColor, andThetaColor property values in the light theme have changed slightly. This table lists the changes.

Property R2024b Color R2025a Color
ColorOrder RGB TripletSample[0.0000 0.4470 0.7410] Sample of dark blue color (R2024b)[0.8500 0.3250 0.0980] Sample of dark orange color (R2024b)[0.9290 0.6940 0.1250] Sample of dark yellow color (R2024b)[0.4940 0.1840 0.5560] Sample of dark purple color (R2024b)[0.4660 0.6740 0.1880] Sample of medium green color (R2024b)[0.3010 0.7450 0.9330] Sample of light blue color (R2024b)[0.6350 0.0780 0.1840] Sample of dark red color (R2024b) RGB TripletSample[0.0660 0.4430 0.7450] Sample of dark blue color (R2025a)[0.8660 0.3290 0.0000] Sample of dark orange color (R2025a)[0.9290 0.6940 0.1250] Sample of dark yellow color (R2025a)[0.5210 0.0860 0.8190] Sample of dark purple color (R2025a)[0.2310 0.6660 0.1960] Sample of medium green color (R2025a)[0.1840 0.7450 0.9370] Sample of light blue color (R2025a)[0.8190 0.0150 0.5450] Sample of dark magenta color (R2025a)
RColor andThetaColor [0.15 0.15 0.15] [0.1294 0.1294 0.1294]

Specify the location of zero degrees as an angle value by setting theThetaZeroAxisLocaton property to a value such as45 (when the ThetaAxisUnits property is"degrees") or pi/4 when theThetaAxisUnits property is"radians").

The existing options, "right", "left","top" and "bottom", are also supported.

The FontSmoothing property has no effect and will be removed in a future release. You can set or get the value of this property without warning, but all text is smooth regardless of the property value. This property removal was announced in R2022a.

For polaraxes objects created in App Designer or in figures created using the uifigure function, you can customize the behavior of axes interactions. Customize the behavior of data tips by using theInteractionOptions property.

Use the LineStyleCyclingMethod property to control how different lines are distinguished from one another in the axes.

Now you can control the selection mode for the _r_-axis tick label rotation by setting the RTickLabelRotationMode property.

You can remove all the tick marks from the axes by setting theTickDir property to "none".

You can control the alignment of a plot title by setting theTitleHorizontalAlignment property of the axes to"left", "right", or"center".

Add a subtitle to your plot by setting the Subtitle property or calling the subtitle function. To control the appearance of the subtitle, set the SubtitleFontWeight property.

Set the PositionConstraint property of aPolarAxes object to control the space around the axes when you add or modify decorations such as titles and axis labels.

Setting or getting ActivePositionProperty is not recommended. Use thePositionConstraint property instead.

There are no plans to remove ActivePositionProperty, but the property is no longer listed when you call the set, get, orproperties functions on the axes.

To update your code, make these changes:

Setting or getting UIContextMenu property is not recommended. Instead, use the ContextMenu property, which accepts the same type of input and behaves the same way as theUIContextMenu property.

There are no plans to remove the UIContextMenu property, but it is no longer listed when you call the set, get, orproperties functions on the PolarAxes object.

Use the Layout property to position aPolarAxes object within a tiled chart layout.

If you change the axes ColorOrder orLineStyleOrder properties after plotting into the axes, the colors and line styles in your plot update immediately. In R2019a and previous releases, the new colors and line styles affect only subsequent plots, not the existing plots.

To preserve the original behavior, set the axes ColorOrderIndex orLineStyleOrderIndex property to any value (such as its current value) before changing the ColorOrder orLineStyleOrder property.

There is a new indexing scheme that enables you to change the colors and line styles of existing plots by setting the ColorOrder orLineStyleOrder properties. MATLAB applies this indexing scheme to all objects that have aColorMode, FaceColorMode,MarkerFaceColorMode, or CDataMode. As a result, your code might produce plots that cycle though the colors and line styles differently than in previous releases.

In R2019a and earlier releases, MATLAB uses a different indexing scheme which does not allow you to change the colors of existing plots.

To preserve the way your plots cycle through colors and line styles, set the axesColorOrderIndex or LineStyleOrderIndex property to any value (such as its current value) before plotting into the axes.

You can create a customized set of chart interactions by setting theInteractions property of the axes. These interactions are built into the axes and are available without having to select any buttons in the axes toolbar. Some types of interactions are enabled by default, depending on the content of the axes.

Use the Toolbar property to add a toolbar to the top-right corner of the axes for quick access to data exploration tools.