Different color for different parts of MATLAB title

穿精又带淫゛_ 提交于 2019-12-12 10:39:09

问题


I have, what I think might be a 'simple' problem. I know how to change the color of a MATLAB title. What I do not know, is how to use two different colors, at two different parts of the title.

For example, lets say the title of a figure said "Hello World". Then, I want the "Hello" to be in black, while the "World" to be in blue.

How to do this? Thank you.


回答1:


You can use TeX markup to do that. Here's an example:

title(['Hello {\color{blue}World}']);



回答2:


% Create text
text('Parent',axes1,...
'String','\fontsize{20} \color{black}Hello \color{blue}World',...
'Position',[4 95 0]);


来源:https://stackoverflow.com/questions/16468549/different-color-for-different-parts-of-matlab-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!