-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Milestone
Description
Any draggable annotation is displayed in the wrong position after dragging (i.e. nowhere near the mouse cursor) if either of the initial XY coordinates is negative. Minimal example:

import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rcdefaults()
mpl.rcParams['toolbar'] = 'none'
plt.figure(figsize=(5, 2))
plt.plot(range(-10, 10))
an1 = plt.annotate(s='good', xy=(15, 5), bbox={'alpha': 0.5})
an1.draggable()
an2 = plt.annotate(s='bad', xy=(5, -5), bbox={'alpha': 0.5})
an2.draggable()
plt.show()It is caused by the reference coordinates being set apparently incorrectly here: https://github.com/matplotlib/matplotlib/blob/8a270fcc64197ee00c818ec8f9ccc9f0e884828a/lib/matplotlib/text.py#L1597-1605
Using matplotlib 1.4.3 with various OSes/backends.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels