Surround color for display
이전 댓글 표시
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?
채택된 답변
추가 답변 (1개)
Image Analyst
2022년 6월 15일
0 개 추천
Why not just write 0's to those pixels instead of NaNs?
댓글 수: 4
Charles Campbell
2022년 6월 15일
Image Analyst
2022년 6월 17일
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
2022년 6월 17일
Image Analyst
2022년 6월 17일
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.
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

