How to make only some part of a y axis label italic?
조회 수: 232 (최근 30일)
이전 댓글 표시
I am trying to label my y axis with something called a glass transition temperature. This is expressed in text as Tg (where the T needs to be italic, but the g is regular font and subscripted). I have tried ylabel('\it T_g ,[°C]') but it italicizes the entire axis label.
Any idea how to do this?
댓글 수: 0
채택된 답변
Bart Kieviet
2018년 9월 11일
편집: Bart Kieviet
2018년 9월 11일
It's:
ylabel('{\it T}_g ,[°C]')
So with {} around the text that needs to be italic.
댓글 수: 5
Bart Kieviet
2021년 1월 8일
편집: Bart Kieviet
2021년 1월 8일
If I run your code on Matlab 2020a, I get the following:

Is this not what is required?
Code run:
xlabel('$x_3$ (kg/ms$^2$)','fontsize',16,'Interpreter','latex')
mukul chankaya
2021년 3월 2일
Thankyou very much, used the same command for .fig file (propoerty editor) it worked. Thanks again
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!