Clear Filters
Clear Filters

vertical alignment of x-axis labels in bar charts

19 views (last 30 days)
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.

Accepted Answer

Voss
Voss on 31 Mar 2024
Edited: Voss on 31 Mar 2024
ax = gca();
ax.XAxis.TickLabelRotation = 45; % <- or whatever angle you want

More Answers (0)

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!