I have a script which is supposed to do the following:
1) Allow the user to select two points (one in each subplot)
2) Let the user decide if the points are hit accurately enough
For this, I would like to use ginput. There are,however, two issues:
1) I cannot zoom or move the image around withut ginput registering this as a click. My code is:
fig = plt.figure()
ax1 = fig.add_subplot(121)
ax1.imshow(img[:,:,0])
ax2=fig.add_subplot(122)
ax2.imshow(img[:,:,1])
pts = plt.ginput(2, timeout=-1, mouse_add=3, mouse_stop=1, mouse_pop=2)
I would like to remove the mouse_stop command completely, i.e. that right-clicking selects a point, whereas middle-click deletes the selected point. I want to be able to use left-click to navigate around the plot. I have tried:
mouse_stop=None
mouse_stop=4
And in both cases, left-click simply performs the same action as right-click (i.e. selects a point). Any suggestion on how I could assign no action to the left button?
2) The points disappear once selected. I would like to be able to plot these points, so that the user can decide whether or not they are hit well enough (this is for image alignment purposes, and therefore requires high precision). I have tried:
ax1.plot(pts[0][0], pts[0][1])
ax2.plot(pts[1][0], pts[1][1])
However, this does not seem to produce any points. Does anyone have any suggestion for how to display the points?
EDIT: If anyone has a nice, easy, solution for verifying that the user indeed selects one point from each subplot (and not two from one of them), and in the correct order (right-to-left), I would be very grateful for that too :)