Xticklabel to split into two lines
이전 댓글 표시
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

채택된 답변
추가 답변 (1개)
Voss
2021년 12월 10일
Maybe this will work:
set(gca(),'XTickLabel',{'Concrete' 'Masonry' 'Steel' sprintf('Steel/concrete\\newlinecomposite')});
카테고리
도움말 센터 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!