Commit 37ff0e0
committed
Don't force anncoords to fig coords upon dragging.
Minimal example:
from matplotlib import pyplot as plt
plt.annotate("foo", (.5, .5),
(15, 15), textcoords="offset points",
arrowprops={"arrowstyle": "->"},
bbox={"ec": "k"}).draggable()
plt.show()
Panning the axes shows that the annotation uses offset coordinates: it moves
"with" the point it points to. However, (before this patch is applied,) after
dragging the annotation somewhere else, it switches to figure coordinates: when
panning the axes, the text box stops physically moving; instead it's the arrow
that moves to follow the point.
The fix actually makes the code simpler...1 parent 3f7e675 commit 37ff0e0
1 file changed
Lines changed: 3 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1750 | 1750 | | |
1751 | 1751 | | |
1752 | 1752 | | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
| 1753 | + | |
1765 | 1754 | | |
1766 | 1755 | | |
1767 | 1756 | | |
1768 | | - | |
1769 | | - | |
1770 | | - | |
1771 | | - | |
1772 | | - | |
1773 | | - | |
1774 | | - | |
1775 | | - | |
1776 | | - | |
| 1757 | + | |
| 1758 | + | |
1777 | 1759 | | |
1778 | 1760 | | |
1779 | 1761 | | |
| |||
0 commit comments