问题
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