How to make only some part of a y axis label italic?
799 次查看(过去 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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/481958/image.png)
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!