如何在MATLAB中创建该图形标题? [英] How can I create this figure title in MATLAB?

查看:466
本文介绍了如何在MATLAB中创建该图形标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用以下内容将乳胶,数字和Tex组合到图形的标题中(beta_blambda是已定义的变量):

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的任一侧都包含$,以便可以正确解释它们. $也必须位于\mum之间,否则它会在\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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆