For horizontal axis of my plot I have int64 type numpy array.
Then I’ve linked button press event to the plot:

plt.connect("button_press_event", on_click)

This is the handler

def on_click(event):
    cursor_x = event.xdata
    ...

What I see is non-integer interpolated xdata. How can I avoid interpolation and get the nearest datapoint from x axis in handler function?