How to code the colors in MATLAB?

조회 수: 1 (최근 30일)
M G
M G 2011년 9월 6일
Hey all,
I was just wondering how I can find the codes for colors in Matlab. Furthermore, what are the related commands in order to use them? e.g. how can I make a RED word?
Thanks a lot :)

답변 (1개)

Paulo Silva
Paulo Silva 2011년 9월 6일
Example:
plot(1,1,'*','MarkerEdgeColor','r')
or
plot(1,1,'*','MarkerEdgeColor',[1 0 0])
does the same thing
More red examples
%figure with red background
set(figure,'color',[1 0 0])
and
%axes with red background
set(axes,'color',[1 0 0])
Finally red text
text(0.1,0.1,'Hello MATLAB user','color',[1 0 0])
If you are looking for red text on the command line you must use cprintf
  댓글 수: 2
M G
M G 2011년 9월 6일
Hey Paulo, Thanks so much for help :)
May I ask you another related question?
Suppose we have a picture. All coordinates of the pixels have already been imported to Matlab (let's say a 600x800). If I want to change a particular voxel(s) of this picture to red or any other color what would be the solution?
Paulo Silva
Paulo Silva 2011년 9월 6일
I'm not the best person to help you with those questions, please create another question and provide more details, someone else will help you.

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

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by