-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Feature request: set_XY in quiver plots #11790
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
Comments
Seems a reasonable addition. OTOH, I wouldn't necessarily have thought |
I can think of lots of uses for something like this. For example, lets say I have a vector field and I want to apply a rotation to it. It would be nice to see the vector field actually rotate, and not just the arrows changing direction. I'll admit that changing the location of the arrows is more niche than setting the direction, so that's why I think a For api consistency, we'd probably want a |
My gut says there's probably some implementation details that make this more than trivial, but I'd be willing to merge the work of someone else doing this. 😁 |
I don't know if this is a good method, but it can be done with |
This is kind of related too. If you increase the number of arrows with set_offsets and then try to update the (U,V) with set_UVC you will get a ValueError even if both are the same dimension. The following code procs the error in 3.3.2
|
@daniel-cr Changing the number of arrows is currently not supported consistently (we should proabably already fail on |
I know it is not the best way of doing it but if you really want to change the number of arrows, matplotlib version 3.1.3 allows you to do it :) |
@thevincent could you please show me how it is done? |
@yasser-h-khalil here is a simple example with matplotlib 3.1.3 :
Which produces this following : |
Thank you this works. It seems this feature is available only on version 3.1.3, as I tried on 3.3.2 and it failed. I had it like this:
Any suggestions. Thanks. |
I would love to do this in matplotlib 3.3.3, too. |
@yasser-h-khalil, it should work if you use : |
Just to re-iterate - I'm sure we would accept a PR for setting I will also re-iterate that this is all likely better done with |
True. It works. However, I noticed it is a slow command. Thanks. |
@yasser-h-khalil Please take user-help to discourse.matplotlib.org. Thanks! |
See #22407 for a possible |
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help! |
Quiver plots currently have a
set_UVC
method which lets one animate the direction that the arrows point. Unfortunately, they do not have aset_XY
, so one cannot animate the location of the arrows.This limitation makes is hard to make things like: (An animation of elliptical polarization)

without resorting to simply clearing the axis, and redrawing everything on every frame. This annoyance get's compounded with even more complex animations.
The text was updated successfully, but these errors were encountered: