如何在MATLAB中创建该图形标题? [英] How can I create this figure title in MATLAB?
问题描述
我想使用以下内容将乳胶,数字和Tex组合到图形的标题中(beta_b
和lambda
是已定义的变量):
I want to combine Latex, numbers, and Tex into the title of a figure using the following (beta_b
and lambda
are defined variables):
title(['$\overline{\beta}=$' num2str(beta_b) 'TE0 , \lambda=' num2str(lambda*1e6) ' \mum'], 'interpreter','latex');
但是它不能正确显示.有什么问题吗?
But it doesn't display properly. What's the problem?
推荐答案
您不能在 'Interpreter'
属性).以下将起作用:
You can't combine Latex and Tex in a title. You have to use one or the other (i.e. whichever one you set for the 'Interpreter'
property). The following will work:
title(['$\overline{\beta}=$' num2str(beta_b) ...
' TEO , $\lambda=$' num2str(lambda*1e6) ' $\mu$m'],...
'Interpreter','latex');
请注意,必须在\lambda
和\mu
的任一侧都包含$
,以便可以正确解释它们. $
也必须位于\mu
和m
之间,否则它会在\mum
上绊倒.
Note that you have to include $
on either side of \lambda
and \mu
so they can be interpreted properly. The $
also has to go between the \mu
and m
, otherwise it gets tripped up on the \mum
.
这篇关于如何在MATLAB中创建该图形标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!