MATLAB Answers

edgecolor of pixels of imagesc

조회 수: 22(최근 30일)
Ankit Labh
Ankit Labh 2020년 5월 25일
I want the black edge color for the boundaries of each pixel drawn using imagesc. If I use pcolor, I get the black boundary around pixels. How can I get the same using 'imagesc'?


Image Analyst
Image Analyst 2020년 5월 25일
편집: Image Analyst 2020년 5월 25일
You can't. And if you use pcolor, you don't either. The tiles you see in pcolor are NOT pixels. Look closely. If you want to show a 4x4 array with pcolor, do you see a 4x4 array of pixels?
m = magic(4)
No, you don't. Those black lines goes through the MIDDLE of the pixels, they don't surround them. And to make it worse, you see a 3x3 array of tiles, not a 4x4 array. Very deceiving so that's why I never use pcolor().

Aaron T. Becker's Robot Swarm Lab
The function pixelgrid superimposes a grid of pixel edges on an image. The purpose is to easily visualize pixel extents when zooming in closely on an image. The grid is drawing using lines with contrasting colors so that it is visible regardless of the colors of the underlying pixels.
Cite As
Steve Eddins (2021). Pixel Grid (, GitHub. Retrieved January 25, 2021.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by