How can I produce colours to distinguish between points in a plot?
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi all,
I am wondering how can I produce extra colours to use them in a plot. For example, I want to have extra colours more than what I have here in an array.
color = 'rmcgyk';
Each letter corresponding for a colour but for my purposes, they are not enough!
Is there a way to have more?
Thank you
댓글 수: 0
답변 (2개)
Ced
2014년 11월 3일
편집: Ced
2014년 11월 3일
Sure, you can define colors through their (normalized) RGB values, e.g. [ 0 0 0 ] is black, [1 1 1] is white, and then you can choose anything in between. There are also lots of color-generators around like
On a side-note: There are tons of options for the plotting functions, just check out the documentation (type "doc plot" into matlab).
댓글 수: 0
Image Analyst
2014년 11월 3일
You can do
plot(x, y, 'Color', [r, g, b]);
Where r, g, and b go from 0 to 1. If you want that to happen automatically, see my color order demo, attached below the image.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176475/image.jpeg)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Formatting and Annotation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!