Surround color for display
Mostrar comentarios más antiguos
When I create a display using pcolor of data that is contained within a circle I insert NaN values in all locations not within the circle and then the display creates white areas where the NaNs are located. Is there any way I can get this same effect but have the surround black instead of whiite?
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 15 de Jun. de 2022
0 votos
Why not just write 0's to those pixels instead of NaNs?
4 comentarios
Charles Campbell
el 15 de Jun. de 2022
Image Analyst
el 17 de Jun. de 2022
Why would that be? Do you have an indexed image? If so just assign the value to the value in the colormap that is black.
Charles Campbell
el 17 de Jun. de 2022
Image Analyst
el 17 de Jun. de 2022
I did think of that, or something like that. It really doesn't matter if the matrix values represent an intensity like a regular gray scale image or a height or elevation. I was thinking values were brightness but they just as well could have been elevation. That's why I suggested using a colormap and it looks like you found a working solution using that. You should also look at the function clim (r2022a or later) or caxis (r2021b or earlier).
But @DGM presented an alternative way and it looks like you preferred that way since you accepted the answer.
Categorías
Más información sobre Color and Styling 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!

