How to change the angle of xticklabel?

6 visualizaciones (últimos 30 días)
Leon
Leon el 2 de Feb. de 2022
Editada: Voss el 2 de Feb. de 2022
Matlab has been automatically slanting my xTickLabels even when the font size is not that big and can fit the x-axis just fine without angled.
Is there a way to force it to be angled at 0-degrees (i.e., not slanted)?
Many thanks!

Respuesta aceptada

Voss
Voss el 2 de Feb. de 2022
Editada: Voss el 2 de Feb. de 2022
You can use set(gca(),'XTickLabelRotation',0);
To demonstrate:
figure();
plot(1:10);
set(gca(),'XLim',[1 10],'XTick',1:0.5:10,'Fontsize',16); % automatically rotated
figure();
plot(1:10);
set(gca(),'XLim',[1 10],'XTick',1:0.5:10,'Fontsize',16,'XTickLabelRotation',0); % force to horizontal

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by