Show 2D array (grayscale image) in heatmap in python -


i'm beginner in working images in python , i'm trying display 2d array, 500px x 500px, array((500, 500)), display grayscale image color image, in heatmap. i this:

to displayed this: enter image description here

i tried couldn't find answers in internet, , found didn't work me. please help.

i don't have code, know one:

my_img = plt.imread(filename) plt.imshow(my_img, cmap="hot") 

doesn't work, displays same image, in grayscale.

try giving pcolor try. it's more usual analogy "heatmap". imshow more aligned display of images true color values in array. fact ideal image inverted practice image tells me pcolor might better choice.