Using Python 3.6+, Jupyter notebooks and matplotlib, I want to find out how to get the x,y position of an image by moving the mouse over it and/or clicking the position
I'm using any image, for example a png sized 966 x 525 pixel.
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
fig = plt.figure(figsize=(20,30))
img=mpimg.imread('ausgabe.png')
imgplot = plt.imshow(img)
plt.show();
Many suggested solutions on stackoverflow involve connecting an event to matplotlib, like
fig.canvas.mpl_connect('button_press_event', onclick)
(see Store mouse click event coordinates with matplotlib)
But in Jupyter that just doesn't react. Instead clicking on the image sometimes enlarges it.
What is a good way to display a png in Jupyter so that I could collect (=print) the click positions - or rerun the cell with the collected information?

