import numpy as np
from matplotlib import pyplot as plt
haha = np.zeros((2, 2))
img = plt.imshow(haha)
print(img.get_array())
haha[1, 1] += 1
img.set_data(haha)
img = plt.imshow(haha)
print(img.get_array())
plt.show()
Matplotlib: no effect of set_data in imshow for the plot