Borrar filtros
Borrar filtros

vertical alignment of x-axis labels in bar charts

19 visualizaciones (últimos 30 días)
Richard
Richard el 31 de Mzo. de 2024
Comentada: Adam Danz el 31 de Mzo. de 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.

Respuesta aceptada

Voss
Voss el 31 de Mzo. de 2024
Editada: Voss el 31 de Mzo. de 2024
ax = gca();
ax.XAxis.TickLabelRotation = 45; % <- or whatever angle you want

Más respuestas (0)

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by