im = plt.imshow(happy_array, cmap='gray', interpolation='none')
cbar = plt.colorbar(im)
plt.show()
Given a 2D numpy array of real numbers, how to generate an image depicting the intensity of each number?