Multiple Colors in Matlab Plot

조회 수: 2 (최근 30일)
Adin
Adin 2014년 4월 20일
답변: dpb 2014년 4월 20일
I want to have a plot title that has 2 different colors. So for example, I will have the following sample code:
str1 = sprintf('this');
str2 = sprintf('is a');
str3 = sprintf('test');
title(str1+str2+str3,'FontSize',10);
But I want `str2` to be red in color while `str1` and `str3` are default black in color. How do I change the colors independently?

채택된 답변

dpb
dpb 2014년 4월 20일
doc title % there's an example of multi-color title there
title(['\fontsize{16}black {\color{magenta}magenta '...
'\color[rgb]{0 .5 .5}teal \color{red}red} black again'])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by