我想在两行中写下我的图形标题,以便我可以分别更改两行的文本属性。我发现:
title(['\bf{first line}' char(10) '\rm{second line}'])
这使第一行加粗。但是如何更改第一行的字体大小?
title(['\fontsize{20pt}\bf{first line}' char(10) '\fontsize{10pt}\rm{second line}'])
我发现这个语法隐藏在文档中:http: //www.mathworks.com/help/matlab/creating_plots/adding-text-annotations-to-graphs.html#f0-19466 然后摆弄了一下。
我和 Dan 在一起,但我会省略不直观的内容char(10)
并使用垂直连接的单元格数组:
title({...
'\fontsize{25pt}\bf{first line}'
'\fontsize{8pt}\rm{second line}'
})
结果:
没什么新意,只是更直观、更易读。