how do i get the color gray
Ältere Kommentare anzeigen
how do i get the color gray on my graph
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 23 Mai 2012
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 Kommentare
Khaled Baha
am 29 Jan. 2020
it doesnt work
Walter Roberson
am 29 Jan. 2020
plot(x, y, 'Color', uint8([17 17 17]))
or
plot(x, y, 'Color', [17 17 17]/255)
Zhe Chen
am 28 Jul. 2020
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.
Kategorien
Mehr zu Orange finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


