Different color for different parts of the name MATLAB

I, I think, may have a "simple" problem. I know how to change the color of the name MATLAB. I do not know how to use two different colors in two different parts of the name.

For example, you can say that the name of the figure is indicated by "Hello World". Then I want Hello to be black and Peace to blue.

How to do it? Thanks.

+7
source share
2 answers

You can use TeX markup to do this. Here is an example:

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

enter image description here

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

All Articles