-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add method to update position of arrow patch #27692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
While the arrow patch has fundamental flaws, it's not going to go away soon. So this addition is reasonable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test please? sorry should read things better :/
ax.add_patch(a) | ||
|
||
# code for modifying the arrow | ||
a.set_data(x=.5, dx=3, dy=8, width=1.2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a.set_data(x=.5, dx=3, dy=8, width=1.2) | |
def update(i): | |
a.set_data(x=.5, dx=3, dy=8, width=1.2) |
how would you feel about making this a tiny animation to advertise the purpose of the method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds good. I'll have a go at making an animation
x, y : float or None, default: None | ||
The x and y coordinates of the arrow base. | ||
|
||
dx, dy : float or None, default: None | ||
The length of the arrow along x and y direction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is tedious but I think these need to be documented individually since they come in individually and not as tuples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct as is. numpydoc explicitly allows this:
When two or more input parameters have exactly the same type, shape and description, they can be combined:
PR summary
Closes #14217. Adds
set_data
method fromFancyArrow
that allows the arrow to be repositioned without re-drawing.Arrow's
x,
y,
dx
,dy
andwidth
parameters are now stored in private variables so that they can be reused for recreating the transform.e.g.
See the discussion here #14217 (comment). I don't know what the consensus is on the Arrow class but If this fix is still needed, I'll add a test and a what's new entry.
PR checklist