Xticklabel to split into two lines
Mostrar comentarios más antiguos
Dear All,
hope you are doing well.
I'd very grateful if you cold help me in understanding how to split a label for a bar xtick into two lines.
As you can see from the attached plot, it happens that the string 'Steel/concrete composite' is too long, and I'd would have something like 'Steel/concrete' in the upper line, and 'composite' below, that is
Steel/concrete
composite
Thanks for your time and help in advance, and best!
---
Giuseppe

Respuesta aceptada
Más respuestas (1)
Voss
el 10 de Dic. de 2021
Maybe this will work:
set(gca(),'XTickLabel',{'Concrete' 'Masonry' 'Steel' sprintf('Steel/concrete\\newlinecomposite')});
1 comentario
Giuseppe Degan Di Dieco
el 13 de Dic. de 2021
Categorías
Más información sobre Axis Labels en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!