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!

