I understand using matplotlib.pyplot\'s imshow gives me a nice sketch that can be used to visualize matrices. My question is that when I want to visualize a matrix, the func
You can use the vmin and vmax keyword arguments of imshow as documented here. In particular, if you modify your imshow call to
vmin
vmax
imshow
plt.imshow(k, vmin=0, vmax=1)
the colours will be normalised as if there was a value 0 and a value 1 present in the data.
0
1