Matplotlib draggable data marker

I need a draggable data marker to manually adjust a set of points in a dataset.This answer and others solve this problem using a Patch.Circle. However I need the marker to stay the same size when zooming the plot. With circles the circle zooms too. I haven't tried to find a way of resizing the circle dynamically with each new zoom because it looks there should be a simpler way of just moving a marker. Does anybody know how to do this?

Below, I present a MWE that shows one way to do it with the object oriented API of matplotlib and PyQt4. The data markers are draggable using the middle mouse button. The strategy is to plot your data with a line2D artist and to subsequently drag the markers by manipulating the data of the artist and updating the plot. This can be roughly summarized in 3 steps:

Step 1 - When the middle mouse button is clicked, the coordinates of the mouse cursor in pixels are compared to the xy data, transformed in pixels, of the line2D artist. If the linear distance between the cursor and the nearest marker is less than a given value (defined here as the size of the markers), the index of that data marker is saved in the class attribute draggable. Otherwise, draggable is set to None.

Step 2 - When the mouse is moved, if draggable is not None, the coordinate of the data marker whose index was stored in the class attribute draggable are set to the ones of the mouse cursor.

Step 3 - When the middle mouse button is released, draggable is set back to None.

Note: If desired, it would also be possible to use the pyplot interface to generate the figure instead of the object oriented API.