Reputation: 63
I have two separate plots made by pyplot
using code like this:
img=imread(name)
g=figure(1)
imshow(img)
g.show()
These plots are two different images of the same object.
I need a way to redraw the second plot when I move or change the scale of the first one.
I know how to calculate the position in the other coordinate system and how to set plot limits but I have no idea how to force the second image to refresh when I move around the first one.
Upvotes: 1
Views: 213
Reputation: 63
I figure it out with:
def onclick(self):
...
g.canvas.draw()
refresh=f.canvas.mpl_connect('button_release_event', onclick)
where:
img=imread(name)
f=figure(1)
imshow(img)
f.show()
img2=imread(name)
g=figure(2)
imshow(img2)
g.show()
Upvotes: 0