You should read this tutorial.
Basically you need to define function which takes one arguement event
and then attach it to your figure's canvas:
def open_new_figure(event):
if event.inaxes is not None:
ax = event.inaxes
# you now have the axes object for that the user clicked on
# you can use ax.children() to figure out which img artist is in this
# axes and extract the data from it
cid = fig.canvas.mpl_connect('button_press_event', open_new_figure)