MATLAB使文字以粗体显示

Ben*_*Ben 1 matlab

有没有办法让我添加到图表中的文字变粗?

我使用以下内容添加了文本

text(9,2  , '1,296 atoms', 'Color', 'k');
Run Code Online (Sandbox Code Playgroud)

但是,文字很微弱,很难看到.

Fan*_*Fox 6

您可以使用该FontWeight物业.

text(0.1,0.5  , 'normal', 'Color', 'k');
text(0.5,0.5  , 'bold', 'Color', 'k', 'FontWeight', 'bold');
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

通常,如果要查看打印类型的可编辑属性,可以执行简单的调用:

t = text(0.5, 0.5, 'a')
get(t)
Run Code Online (Sandbox Code Playgroud)

这将显示所有可编辑属性.然后,在MathWorks页面中搜索要设置它们的值会更容易一些.

有关text属性的更多信息,请访问:http://www.mathworks.com.au/help/matlab/ref/text_props.html