Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

matplotlib.pyplot.quiver

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
)

enter image description here

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]?

question from:https://stackoverflow.com/questions/65946561/explanation-of-matplotlib-quiver-arguments

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
354 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...