vertical alignment of x-axis labels in bar charts

11 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Line Plots in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by