how do i get the color gray
Afficher commentaires plus anciens
how do i get the color gray on my graph
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 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 commentaires
Khaled Baha
le 29 Jan 2020
it doesnt work
Walter Roberson
le 29 Jan 2020
plot(x, y, 'Color', uint8([17 17 17]))
or
plot(x, y, 'Color', [17 17 17]/255)
Zhe Chen
le 28 Juil 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.
Catégories
En savoir plus sur Subplots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


