在matplotlib的3D颤抖中改变箭头长度

时间:2016-03-09 09:00:46

标签: python matplotlib mplot3d

我尝试在matplotlib(用于3D)中使用单个箭头命令创建不同长度的箭头。对于 2D 版本的箭袋,我得到了不同长度的箭头,但它们没有缩放:

x = linspace(0, 10, 11)

fig = plt.figure()
ax = fig.gca()
ax.quiver(x, zeros(x.shape), zeros(x.shape), x)

enter image description here

如何获得2D版本的正确缩放(长度为1,2,3,4 ......的箭头)?

对于 3D ,所有箭头的长度完全相同,我只能使用length参数更改整个集合的长度:

fig = plt.figure()
ax = fig.gca(projection='3d')
ax.quiver(x, zeros(x.shape), zeros(x.shape), zeros(x.shape), x, zeros(x.shape), pivot='tail')
ax.set_ylim([-1, 2])
ax.view_init(90, -90)

enter image description here

如何根据我设置的u, v, w参数设置尺寸?

0 个答案:

没有答案
相关问题