How can I assign different colors to two-line plot title?
이전 댓글 표시
Hello,
I want to assign different colors to each line of the two-line plot title. I tried to solve as,
title({'FAS of NS';'Select the low filter limit'},'Color',{'m';'r'});
but I couldn't get a result. Can you please help find a solution?
채택된 답변
추가 답변 (1개)
Mayra
2021년 5월 29일
It was complicate for me to realize that we simply need to create a string as described in the help center, which is:
title(['\fontsize{16}black {\color{magenta}magenta '...
'\color[rgb]{0 .5 .5}teal \color{red}red} black again'])
In my case I created two strings:
t1 - title at the first line
t2 - title at the second line
The colors for each line were C1 and C2 in rgb form (e.g. C1 = [ 5.95010505e-01, 7.71902878e-02, 6.27916992e-01];
Then it was necessary create two new strings combining my title, the command for color and the color itself:
title({['\color[rgb]{',num2str(C1),'}',t1],...
['\color[rgb]{',num2str(C2),'}',t2]})
카테고리
도움말 센터 및 File Exchange에서 Title에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!