Hi,
My axis label is very long and it is in two lines. How can I center the text (for example I want "trajectory angle" to be centered)?
ylabel(['Trajectory angle \newline with respect to vortex axis ( ' char(176), ' )'],'FontSize',axisFont);

 채택된 답변

Star Strider
Star Strider 2020년 7월 7일

2 개 추천

Try this:
ylabel({'Trajectory angle';'with respect to vortex axis (°)'})
That worked when I tested it.
See the documentation section on: Create Multiline Label for details.
This also works:
ylabel(sprintf('Trajectory angle\nwith respect to vortex axis (°)'))
.

댓글 수: 2

delmi3
delmi3 2020년 7월 7일
Thank you. It worked!
Star Strider
Star Strider 2020년 7월 7일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Axis Labels에 대해 자세히 알아보기

질문:

2020년 7월 7일

댓글:

2020년 7월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by