使用matlab Latex解释器时如何将字体更改为times new roman?

问题描述 投票:0回答:1

我使用matlab绘制的x轴名称图是“归一化时间t/T”,其中“归一化时间”应该是times new roman字体,与我的论文的正常字体相同,并且t/T应该是数学心情。如何使用 matlab Latex 解释器来做到这一点?

例如,如果我写 xlabel('归一化时间$t$', 'Fontsize',10,'Interpreter',"latex"); 在Matlab中,我得到 enter image description here 在matlab图中,但我真正想要得到的是 enter image description here

matlab plot latex
1个回答
0
投票

在标签中混合乳胶时,Matlab 的字体支持有限。您可以尝试的一种技巧是在没有乳胶解释器的情况下使用 xlabel,找到它的位置,然后使用乳胶在其旁边添加文本。例如:

plot(rand(2))
xlabel('Normalized time', 'Fontsize',20,'FontName',"Impact"); % just text, no latex
% get the xlalbel position
a=get(get(gca,'XLabel'),'Extent'); % [left,bottom,width,height]
text(1.01*(a(1)+a(3)),a(2)+a(4)/2,'$\frac{t}{T}$','Fontsize',20,'Interpreter',"latex")

© www.soinside.com 2019 - 2024. All rights reserved.