vertical alignment of x-axis labels in bar charts

11 次查看(过去 30 天)
Is there a way to rotate the category-labels on the x-axis in a bar chart?
I've got this code:
x = ["Spring" "Summer" "Autumn" "Winter"];
y = [1 2 3 4];
bar(x,y)
Thanks.

采纳的回答

Voss
Voss 2024-3-31
编辑:Voss 2024-3-31
ax = gca();
ax.XAxis.TickLabelRotation = 45; % <- or whatever angle you want

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Bar Plots 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by