Please help understand what X, Y, U, V are in quiver and explain what the thoughts or designs of quiver. Personally, when I see X, Y, U, V
, I assume U, V
are the basis vectors of the coordinate system and X, Y
are the actual vectors in the system where X = αU
with scalar α and Y = βV
with scalar β. However it looks they are not.
U and V are the arrow data, X and Y set the locaiton of the arrows, and C sets the color of the arrows. These arguments may be 1-D or 2-D arrays or sequences. If X and Y are absent, they will be generated as a uniform grid.
quiver(U, V, **kw)
quiver(U, V, C, **kw)
quiver(X, Y, U, V, **kw)
quiver(X, Y, U, V, C, **kw)
X : 1D or 2D array, sequence, optional
The x coordinates of the arrow locations
Y : 1D or 2D array, sequence, optional
The y coordinates of the arrow locations
U : 1D or 2D array or masked array, sequence
The x components of the arrow vectors
V : 1D or 2D array or masked array, sequence
The y components of the arrow vectors
C : 1D or 2D array, sequence, optional
How to plot vectors in python using matplotlib shows an answer using quiver as below. The X, Y
arguments [0, 0, 0],[0, 0, 0]
and U, V
be [1, -2, 4], [1, 2, -7]
, which looks indicating X, Y are origin, and U, V are the arrow vectors.
plt.quiver(
[0, 0, 0],
[0, 0, 0],
[1, -2, 4],
[1, 2, -7],
angles='xy', scale_units='xy', scale=1
)
Q1
What does "X and Y set the location of the arrows" mean? It looks X, Y
are the origin of coordinates, so it says X, Y sets the where the origins for U, V are?
Q2
Do U, V
represent the actual vector components? For instance, in a cartesian coordinate system of two axis x and y. A vector (1, 1) will be represented as U=[1], V=[1]
?