how do i get the color gray
Mostrar comentarios más antiguos
how do i get the color gray on my graph
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 23 de Mayo de 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 comentarios
Khaled Baha
el 29 de En. de 2020
it doesnt work
Walter Roberson
el 29 de En. de 2020
plot(x, y, 'Color', uint8([17 17 17]))
or
plot(x, y, 'Color', [17 17 17]/255)
Zhe Chen
el 28 de Jul. de 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.
Categorías
Más información sobre Subplots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


