I have a strange error that I cannot fix without your help. After I installed the image with imshow
in matplotlib, it remains unchanged all the time, even if I change it using the set_data
method. Just take a look at this example:
import numpy as np from matplotlib import pyplot as plt def newevent(event): haha[1,1] += 1 img.set_data(haha) print img.get_array()
After I build it, the set_data
method set_data
not change anything inside the graph. Can someone explain to me why?
EDIT
Just added a few lines to indicate what I really want to do. I want to redraw the data after clicking the mouse button. I do not want to delete the whole figure, because it will be stupid if only one thing changes.
ahelm source share