I generated a figure using mpld3 and linked it to plugins.MousePosition() to display the coordinates, as below.
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import mpld3
from mpld3 import plugins, utils
x,y = np.random.rand(2,10)
fig, ax = plt.subplots()
ax.scatter(x,y,s=10,c='orange')
plugins.connect(fig, plugins.MousePosition())
mpld3.show()
The mouse position is reported in the lower right hand corner, which means the x,y coordinates can be read somehow. Is there a way to use the coordinate information to draw a polygon based on mouse click(s) and double click?