ytickangle

Gets or sets the rotation angle of the y-axis tick labels.

Category: Graphics > Formatting and Annotation

Syntax

ytickangle(angle)

Rotates the tick labels by angle degrees.

a = ytickangle

Returns the current angle.

ytickangle(ax, ___)

Acts on the axes ax.

Description

Rotating the y tick labels is less common than for x, but it helps when the labels are long. The angle is stored in the property YTickLabelRotation of the axes.

Input arguments

angle
Rotation in degrees, counterclockwise. The default is 0; 90 gives vertical text.

Output arguments

a
Current rotation in degrees.

Example

Tilted labels

plot(1:4)
yticks(1:4)
yticklabels({'very low', 'low', 'high', 'very high'})
ytickangle(30)
a = ytickangle
Output
a = 30

See also

xtickangle yticklabels yticks ytickformat