Documentation

ztickangle

Rotatez-axis tick labels

Syntax

ztickangle(angle)
ztickangle(ax,angle)
ang = ztickangle
ang = ztickangle(ax)

Description

example

ztickangle(angle)rotates thez-axis tick labels for the current axes to the specified angle in degrees, where0is horizontal. Specify a positive value for counterclockwise rotation or a negative value for clockwise rotation.

example

ztickangle(ax,angle)rotates the tick labels for the axes specified byaxinstead of the current axes.

example

ang= ztickanglereturns the rotation angle for thez-axis tick labels of the current axes as a scalar value in degrees. Positive values indicate counterclockwise rotation. Negative values indicate clockwise rotation.

ang= ztickangle(ax)uses the axes specified byaxinstead of the current axes.

Examples

collapse all

Create a surface chart and rotate thez-axis tick labels 45 degrees clockwise.

[x,y,z] = peaks; surf(x,y,z) ztickangle(-45)

Create a figure with two subplots and return the axes objects asax1andax2. Rotate thez-axis tick labels for the lower subplot by specifyingax2as the first input argument toztickangle.

ax1 = subplot(2,1,1); stem3(2*rand(5)) ax2 = subplot(2,1,2); stem3(2*rand(5)) ztickangle(ax2,-45)

Create a surface chart. Then, query the rotation angle for thez-axis tick labels. By default, the labels are not rotated.

[x,y,z] = peaks; surf(peaks)

ang = ztickangle
ang = 0

Input Arguments

collapse all

Rotation of tick labels, specified as a scalar value in degrees, where 0 is horizontal.

Example:ztickangle(90)

Target axes, specified as a singleAxesobject or a vector ofAxes对象。如果你不specify the axes, thenztickangleuses the current axes.

Algorithms

Theztickanglefunction sets and queries theZTickLabelRotationproperty of theAxesobject.

Introduced in R2016b

Was this topic helpful?