Don't force anncoords to fig coords upon dragging.#6892
Don't force anncoords to fig coords upon dragging.#6892tacaswell merged 1 commit intomatplotlib:masterfrom
Conversation
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...
| ann.xyann = self.ox + dx, self.oy + dy | ||
| x, y = ann.xyann | ||
|
|
||
| def finalize_offset(self): |
There was a problem hiding this comment.
🐑 I should read before commenting more often, this makes it fall back to the no-op baseclass implementation.
|
👍 Awesome when bug fixes remove code! |
…ords FIX: Don't force anncoords to fig coords upon dragging.
|
backported to v2.x as 06feaf6 (you can tell I was on the fence about this my the re-re-re-(..) milestoning. |
Then why is it 2.0.1 and not 2.0 when it's already backported? |
|
Without really discussing it with anyone I have been using 2.0 -> blocking 2.0.1 -> can be backported, but not blocking. |
|
OK, but that makes things confusing when 2.0.0 is released and stuff on the 2.0.1 milestone needs to be backported. Unless nothing is really supposed to be on the 2.0.1 milestone without a backport? Also, I've been moving this to 2.0 anyway, so maybe that distinction has been lost a bit already... |
|
Everything on the 2.0.1 milestone needs to land on the 2.x branch either via direct merge to 2.x or backport otherwise it can't go into 2.0.1 The only difference as I see it is that 2.0.1 stuff does not need to land before we release 2.0.0 |
|
Yes, of course, but the question is, when it's already on 2.x, should it be tagged 2.0.1? |
See #6783.
Minimal example:
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...