Filter löschen
Filter löschen

vertical alignment of x-axis labels in bar charts

10 Ansichten (letzte 30 Tage)
Richard
Richard am 31 Mär. 2024
Kommentiert: Adam Danz am 31 Mär. 2024
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.

Akzeptierte Antwort

Voss
Voss am 31 Mär. 2024
Bearbeitet: Voss am 31 Mär. 2024
ax = gca();
ax.XAxis.TickLabelRotation = 45; % <- or whatever angle you want

Weitere Antworten (0)

Produkte


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by