我正在绘制一个图形,其中包含向量的路径以及该向量在给定时间的位置。我在 3D 中使用 quiver,但是当我尝试在参数中使用scale或时width,会出现错误。它绘制了向量,但它有一个太大的箭头。形成箭头的两条“边线”太大了。如何让它们变小一点?

ax = plt.axes(projection='3d')
ax.set_autoscalex_on(True)
ax.scatter3D(x, y, z, s=0.4 )
#x, y and z are arrays with coordinates of points
ax.quiver(0, 0, 0, x[10], y[10], z[10], color='red')
{}s'.format(step)
plt.show()
Run Code Online (Sandbox Code Playgroud)
小智 5
您想要使用arrow_length_ratio而不是scale,因为您是在 3d 而不是 2d 中绘图。
这是来自3d matplotlib 对象的文档。
尝试类似的方法:
ax.quiver(0, 0, 0, x[10], y[10], z[10], arrow_length_ratio=0.1, color='red')
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5642 次 |
| 最近记录: |