Main Content

thetalim

Set or query theta-axis limits for polar axes

Description

example

thetalim(limits)specifies the theta-axis limits for the current polar axes. Specifylimitsas a two-element vector of the form[thetamin thetamax], wherethetamaxis a numeric value greater thanthetamin

example

thetalim('auto')lets MATLAB®choose the theta-axis limits. This command sets theThetaLimModeproperty for the polar axes object to'auto'

thetalim('manual')prevents the limits from changing automatically. This command sets theThetaLimModeproperty for the polar axes object to“手动”

tl= thetalimreturns a two-element vector containing the limits for the current polar axes.

m= thetalim('mode')returns the current value of the limits mode, which is either'auto'or“手动”.By default, the mode is automatic unless you specify limits or set the mode to manual.

example

___= thetalim(pax,___)uses the polar axes object specified bypaxinstead of the current polar axes. Specifypaxas the first input argument. Include additional input or output arguments only if the original syntax supported them.

Examples

collapse all

Create a polar plot and change the theta-axis limits.

theta = linspace(0,pi); rho = theta/10; polarplot(theta,rho) thetalim([0 180])

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

Set the limits back to the original values.

thetalim('auto')

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

Set the limits for a specific polar axes by specifying the polar axes object as the first input tothetalim.Otherwise,thetalimsets the limits for the current axes.

pax = polaraxes; thetalim(pax,[0 180])

Figure contains an axes object. The axes object is empty.

Input Arguments

collapse all

Minimum and maximum limits, specified as a two-element vector of the form[thetamin thetamax].When you specify the limits, theThetaLimproperty for the polar axes object updates to the specified values.

Example:[0 1]

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

Output Arguments

collapse all

Current limits, returned as a two-element vector of the form[thetamin thetamax].Querying the limits returns the value of theThetaLimproperty for the polar axes object.

Current limits mode, returned as one of these values:

  • 'auto'— Limits automatically update to reflect changes in the data.

  • “手动”— Limits do not automatically update.

Querying the theta-axis limits mode returns the value of theThetaLimModeproperty for the polar axes object.

See Also

Functions

Properties

Introduced in R2016a