Displaying grid lines in MATLAB imagesc function
I am trying to display solid black grid lines using the imagesc function so that every pixel has a black border around it. I've tried several methods but it seems like no matter the lines always go through the pixel. As an example, for imagesc (randn (21,21)), I'm trying to get a graph where every square (i.e. pixel) here has a black border.
I found one solution here: In Matlab, how to draw a grid over an image , but I'm not sure how to get it to work with imagesc and not Image a.jpg.
I also tried using the hold function to place the lines manually. But every solution seems like the grid lines go through the middle of the pixel. Any help would be greatly appreciated. Thank.
+3
source to share
2 answers