I wish create a custom hover action in matplotlib using the onmove function below. What is the best way of converting existing datapoint values in x and event.x to another coordinate system such as points so that I can detect when event.x is within p points of any data point? I am aware of the picker event, but do not want to use this, as it is based on a click, not a hover.
fig = figure()
ax1 = subplot(111)
x = linspace(0,10,11)
y = x**2
ax1.plot(x,y)
fig.canvas.mpl_connect('motion_notify_event', onmove)
p = 5
def onmove(event):
if event.inaxes:
#Detect if mouse was moved within p points of any value in x