-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
[Doc]: quiver ‘scale_units’ description is not very not clear #28209
Comments
I personally understand that for the scale=None scene, the library will automatically determine the scaling factor to ensure that the vector has visibility and appropriate size within the drawing area. Automatic scaling takes into account the dynamic range of vector amplitude and drawing dimensions to achieve a balance between clarity and information density. When the ideal visual representation is not immediately clear, this is a convenient feature that allows users to focus on the data without manually adjusting the scale from the beginning. |
Hi, can I work on it? |
谢谢,已收到
|
We do not assign issues and you do not need permission to work on an issue. I suspect that a majority of the work here will be to read the code and try out different input to be sure that the docs are correct. There may be enough complexity in this that it is worth writing up an analog to https://matplotlib.org/stable/users/explain/artists/imshow_extent.html for quiver. |
Here are a few code snips that may help understand the quiver argument. import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,200,9)
y = np.linspace(0,100,5)
X,Y = np.meshgrid(x,y)
U = 5*np.ones_like(X)
V = 5*np.ones_like(Y)
#%% understanding "scale"
plt.close('all')
fig, ax = plt.subplots(1,2)
ax_left=ax[0].quiver(x, y, U, V,scale=None)
ax[0].quiverkey(ax_left,X=0.8,Y=1.05,U=5,label='unit',labelpos='W')
ax[0].set_title('')
print('scale is '+str(ax_left.scale))
ax_right=ax[1].quiver(x, y, U, V,scale=1)
ax[0].quiverkey(ax_right,X=0.8,Y=1.05,U=5,label='unit',labelpos='W')
ax[1].set_title('')
print('scale is '+str(ax_right.scale))
plt.savefig('test.png’)
#%% understanding "angle"
fig, ax = plt.subplots(1,2)
ax[0].quiver(x, y, U, V, pivot='mid', angles='uv')
ax[0].set_title('Angle uv')
ax[1].quiver(x, y, U, V, pivot='mid', angles='xy')
ax[1].set_title('Angle xy’)
“”"
Matplotlib documentation
angles : [ ‘uv’ | ‘xy’ ], array, optional
Method for determining the angle of the arrows. Default is ‘uv’.
‘uv’: the arrow axis aspect ratio is 1 so
that if U*==*V the orientation of the arrow on the plot is 45 degrees counter-clockwise from the horizontal axis (positive to the right).
‘xy’: arrows point from (x,y) to (x+u, y+v).
Use this for plotting a gradient field, for example.
my interpretation :
for angles='xy'
The initial point is x=0 , y = 0, then
the new point is : x+U=0+5=5 & y+V = 0+5 = 5
so almost not change in the x compared to the tick space but good change in y
when considered that the next tick is 20
so the wind looks vertical
“”” ``` |
Documentation Link
https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.quiver.html
Problem
All,
Some of the
matplotlib.pyplot.quiver
plot arguments are vague ( based on the questions posted on StackOverflow). I think that the description of the ’scale_units’ could be clarified by:Suggested improvement
Thanks
The text was updated successfully, but these errors were encountered: