-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
quiver does not consider direction of an axis #3709
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
I am confused, the arrows do seem to flip direction as desired.... |
The point is that the arrows are supposed to be showing the gradient, which should be inward regardless of whether any axis is flipped. So something is wrong here, but I don't know where the error is coming in. |
At the second plot the arrows are in the right direction (they are directed inside towards the gradient), but at the first plot (with an image) vertical arrows are reversely directed. If we look at the similar example in MATLAB, we will see that at the first plot arrows are directed inside. Quiver in MATLAB consides flipped Y-axis. |
ah, yes, I understand there needs to be an even number of flips |
I see what is going on; it can be reproduced using our quiver demo. The U and V (vector components) are interpreted in a standard coordinate system regardless of the orientation of the coordinate system for X and Y (the locations). It's surprising that no one tripped over this and brought it up earlier; I can see that it is not the behavior one would expect or want in many cases--although there are cases (including one relevant to me) where it is the preferred behavior. At the moment I am thinking that we will want to add a kwarg to control this behavior--deciding whether the U and V coordinate orientations track X and Y. We have to be careful to handle the angles option consistently. |
Seems like a conflict between two concepts:
I can imagine two various cases using
So, it's should definitely be an option how to orient axis, like efiring said. |
@efiring punting from 1.4.3 as I don't see this getting done in the next week and it has been like this apparently forever. |
@tacaswell, the fix is pretty simple, and I have included a test. I have not yet made a changelog or api changes entry; I want to see whether people are comfortable with the kwarg name and values, or have a better idea. |
I'm trying to plot imshow (it inverts Y-axis) and quiver on the same axes and I see the incorrect direction of vectors for Y-axis. In MATLAB the analogous code working correctly.
My code for example:
The text was updated successfully, but these errors were encountered: