how do i get the color gray
이전 댓글 표시
채택된 답변
추가 답변 (1개)
Walter Roberson
2012년 5월 23일
Gray is any RGB color with Red, Green, and Blue components all equal, excepting black (all 0's) and white (all components the maximum).
For example,
plot(x, y, 'Color', [17 17 17])
댓글 수: 4
Khaled Baha
2020년 1월 29일
it doesnt work
Walter Roberson
2020년 1월 29일
plot(x, y, 'Color', uint8([17 17 17]))
or
plot(x, y, 'Color', [17 17 17]/255)
Zhe Chen
2020년 7월 28일
must be in the range (0 1)
Which MATLAB release are you using?
plot(rand(1,5), 'Color', uint8([17 17 17]))
hold on
plot(rand(1,5), 'Color', [17 17 17]/255)
hold off
works for me.
Note that there are some plot attributes that only accept floating point, such as most Alpha values. In that case you would need the /255 form.
카테고리
도움말 센터 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


