-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Removed normalization of arrows in 3D quiver #5458
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
I removed the normalization of the arrows in 3D quiver to match the behavior of the 2D quiver plot. Also, I changed the default pivot point to be ‘tail’ in order to match the 2D quiver plot. Also, clarified the comment about normalizing the ‘uvw’ variable.
pivot = kwargs.pop('pivot', 'tip') | ||
pivot = kwargs.pop('pivot', 'tail') | ||
# normalize | ||
pivot = kwargs.pop('normalize', False) |
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.
uhm, I think you mean to assign to a variable called "normalize"
This will also likely need to update the image tests, I think (or at least have some of them use |
also added a space before division. Also
I fixed the typos. I don't know much about the tests, but I added "normalize=True" to the quiver3d_demo in order to keep it's behavior the same. |
@@ -14,6 +14,6 @@ | |||
w = (np.sqrt(2.0 / 3.0) * np.cos(np.pi * x) * np.cos(np.pi * y) * | |||
np.sin(np.pi * z)) | |||
|
|||
ax.quiver(x, y, z, u, v, w, length=0.1) | |||
ax.quiver(x, y, z, u, v, w, length=0.1,normalize=True) |
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.
need a space after the comma.
The tests are located in |
Sorry, I was confused about normalize vs the Still think this is a good idea, but not for the reason I used to. This needs an entry in https://github.com/matplotlib/matplotlib/tree/master/doc/api/api_changes with a note about how to return to the original behavior. |
|
||
1) The 3D quiver function previously normalized the arrows to be the same length, which makes it unusable for situations where the arrows should be different lengths and does not match the behavior of the 2D function. This normalization behavior is now controlled with the "normalize" keyword, which defaults to False. | ||
|
||
2) The "pivot" keyword now defaults to "tail" insteaf of "tip". This was done in order to match the default behavior of the 2D quiver function. |
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.
typo, sorry to be picky
If you don't normalize the vectors how does |
In general 👍 . |
Fixed typo, changed quotes, improved descriptions.
Thanks! |
I slightly modified the description of the length keyword argument to indicate that it doesn't actually set the length of the arrows when normalize is False (it just scales them). Let me know if there are other suggestions for this PR. |
👍 from me. Leave this to @WeatherGod to push the button. |
Removed normalization of arrows in 3D quiver
Thank you @DanHickstein! @tacaswell, I take it that this will need to be cherry-picked to v2.0.x branch? |
Yes |
Removed normalization of arrows in 3D quiver
cherrypicked to v2.0.x as bf6e976 |
Awesome! Thanks for your help! |
@DanHickstein Thank you for your work! |
Feedback: Awsome! this modified file works properly and solves the "quiver" problems perfectly! Love your work! |
I removed the normalization of the arrows in 3D quiver to match the behavior of the 2D quiver plot.
Also, I changed the default pivot point to be ‘tail’ in order to match the 2D quiver plot.
Finally, clarified the comment about normalizing the ‘uvw’ variable.
This was suggested here:
#4211