Effacer les filtres
Effacer les filtres

vertical alignment of x-axis labels in bar charts

20 vues (au cours des 30 derniers jours)
Richard
Richard le 31 Mar 2024
Commenté : Adam Danz le 31 Mar 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.

Réponse acceptée

Voss
Voss le 31 Mar 2024
Modifié(e) : Voss le 31 Mar 2024
ax = gca();
ax.XAxis.TickLabelRotation = 45; % <- or whatever angle you want
  3 commentaires
Voss
Voss le 31 Mar 2024
You're welcome!
Adam Danz
Adam Danz le 31 Mar 2024
See also xtickangle.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by