# rticklabels

Set or query r-axis tick labels

## Syntax

rticklabels(labels)
rl = rticklabels
rticklabels('auto')
rticklabels('manual')
m = rticklabels('mode')
___ = rticklabels(pax,___)

## Description

example

rticklabels(labels) sets the r-axis tick labels for the current axes. Specify labels as a string array or a cell array of character vectors; for example, {'January','February','March'}. If you specify the labels, then the r-axis tick values and tick labels no longer update automatically based on changes to the axes.
rl = rticklabels returns the r-axis tick labels for the current axes.

example

rticklabels('auto') sets an automatic mode, enabling the axes to determine the r-axis tick labels. Use this option if you set the labels and then want to set them back to the default values.
rticklabels('manual') sets a manual mode, freezing the r-axis tick labels at the current values.
m = rticklabels('mode') returns the current value of the r-axis tick labels mode, which is either 'auto' or 'manual'. By default, the mode is automatic unless you specify the tick labels or set the mode to manual.

example

___ = rticklabels(pax,___) uses the axes specified by pax instead of the current axes. Specify ax as the first input argument for any of the previous syntaxes.

## Examples

collapse all

Create a polar plot. Display tick marks and grid lines along the r-axis at the values 0.1, 0.3, and 0.5. Then, specify a label for each tick mark.

theta = linspace(0,2*pi); rho = theta/10; polarplot(theta,rho) rticks([0.1 0.25 0.5]) rticklabels({'r = .1','r = .3','r = .5'})

Create a polar plot and assign the polar axes object to the variable pax. Ensure that rticks and rticklabels affect the polar axes you just created by specifying pax as the first input argument to the functions.

theta = 0:0.01:2*pi; rho = 50*sin(2*theta); polarplot(theta,rho) pax = gca; rticks(pax,[10 25 50]) rticklabels(pax,{'r = 10','r = 25','r = 50'})

Create a polar plot and specify the r-axis tick values and corresponding labels. Then, set the r-axis tick values and labels back to the default values.

theta = linspace(0,2*pi); rho = theta/10; polarplot(theta,rho) rticks([0.1 0.25 0.5]) rticklabels({'r = .1','r = .3','r = .5'})

rticks('auto') rticklabels('auto')

Remove the tick labels along the r-axis by specifying the tick labels as an empty array.

theta = 0:0.01:2*pi; rho = 50*sin(2*theta); polarplot(theta,rho) rticklabels({})

## Input Arguments

collapse all

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 {}. Tick labels support TeX and LaTeX markup. See the TickLabelInterpreter property of the axes object for more information.

Example: rticklabels({'0','\pi','2\pi'})

Example: rticklabels({'January','Febrary','March'})

Example: rticklabels({})

Note

• If you specify the tick labels as a categorical array, MATLAB® uses the values in the array, not the categories.

• To specify the tick values, use the rticks function.

Polar axes, or an array of polar axes. If you do not specify this argument, then rticklabels modifies the current axes (provided that the current axes is a polar axes object).

## Output Arguments

collapse all

Current tick labels, returned as a cell array of character vectors or a character array.

Current tick labels mode, returned as one of these values:

• 'auto' — Axes automatically determines the r-axis tick labels.

• 'manual' — Axes uses manually specified r-axis tick labels.

collapse all

### Tick Labels

The tick labels are the labels that you see next to each tick mark. The tick values are the locations along the r-axis where the tick marks appear. Set the tick values using the rticks function. Set the corresponding tick labels using the rticklabels function.

## Algorithms

The rticklabels function sets and queries several polar axes properties related to the r-axis tick labels.

• RTickLabel — Property that stores the text for the r-axis tick labels.

• RTickLabelMode — Property that stores the r-axis tick label mode. When you set the r-axis tick labels using rticklabels, this property changes to 'manual'.

• RTickMode — Property that stores the r-axis tick value mode. When you set the r-axis tick labels using rticklabels, this property changes to 'manual'.

### Properties

Introduced in R2016b