필터 지우기
필터 지우기

How to change the color of a title?

조회 수: 180 (최근 30일)
Bob Choy
Bob Choy 2012년 11월 18일
답변: qwert 2024년 5월 20일
Im using the title(STRING) function to insert a title in the graph I made with the plot funcion. But I need the string to have a certain color, in this case I actually want to have the title saying:
"Month1(in magenta), Month2(in cyan), Month3(in red)"
Obviously I dont want the brackets to be there, its just so you understand what colors I want. How can I do this?
Thank you.
P.S: If there is any easier way of placing a small colored label/title in a graph other than the title(STRING) function, please do tell me!
  댓글 수: 1
Jan
Jan 2012년 11월 18일
Important information from the comments: The questions concerns OCTAVE !

댓글을 달려면 로그인하십시오.

답변 (2개)

Jan
Jan 2012년 11월 18일
편집: Jan 2012년 11월 18일
title('\color{magenta}Month1, \color{cyan}Month2, \color{red}Month3')
It is hard to imagine, that there could be an easier solution. Isn't this nice?
  댓글 수: 6
John Kearns
John Kearns 2022년 5월 5일
Hey Jan,
Sorry to be late to the party on this old post, but do you know if this is possible to change the string colors to colors that are not representable with a single character? I have tried
title(['\color{#CA0066}Mean Vorticity Magnitude'])
as well as
title(['\color{[1. .4 .7020]}Mean Vorticity Magnitude'])
and both of these yielded outputs that were the verbatum title string.
Basically, my aim with this is to be able to use the default color order from plotyy() colors and color the variables represented on the respective axes in my title by the color they are plotted in. So, something similar to the output of
title(['\color{blue}Mean Vorticity Magnitude \color{black}with \color{magenta}Slice Area'])
but with the colors of [0 0.4470 0.7410] and [0.8500 0.3250 0.0980].
I appreciate any help you can offer! Thanks in advance for all the posts you've commented on that have been very instructive for me as I've worked on various problems.
Cheers,
John
Walter Roberson
Walter Roberson 2022년 5월 5일
title(STRING, 'interpreter', 'latex')

댓글을 달려면 로그인하십시오.


qwert
qwert 2024년 5월 20일
\color[rgb]{0,0.447,0.741}

카테고리

Help CenterFile Exchange에서 Title에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by