python matplotlib 3d 箭袋未显示

问题描述 投票:0回答:1

我正在尝试使用 python 中的 matplotlib 绘制箭袋。在原点从上到下移动时应该会出现颤动。

当我运行代码时,绘图显示出来,但没有颤动。

import matplotlib.pyplot as plt

fig = plt.figure(figsize=(3,3))
ax = fig.add_subplot(111,projection='3d')
ax.quiver(0,0,1,0,0,0)
plt.show()

使用 python 3.12.2 和 matplotlib 3.1.2

python matplotlib 3d
1个回答
0
投票

我的论点输入不正确。参数应该是 (x,y,z,dx,dy,dz) 而不是 (x1,y1,z1,x2,y2,z2)。我正在绘制一个 0 长度向量。

来源: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.quiver.html

© www.soinside.com 2019 - 2024. All rights reserved.