这是代码
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.quiver(0, 0, 0, 0, 1, 0)
ax.quiver(0, 0, 0, 1, 0, 0)
ax.quiver(0, 0, 0, 0, 0, 1)
ax.quiver(0, 0, 0, 1, 1, 1)
ax.quiver(0, 0, 0, 0, 3, 0, color='y', alpha=0.5)
ax.quiver(0, 0, 0, 3, 0, 0, color='r', alpha=0.9)
limt = 2
ax.set_xlim([-limt, limt])
ax.set_ylim([-limt, limt])
ax.set_zlim([-limt, limt])
ax.set_xlabel('x_axis')
ax.set_ylabel('y_axis')
ax.set_zlabel('z_axis')
xx, yy = np.meshgrid(np.arange(0,2,.2), np.arange(0,2,.2))
zz = np.zeros((10,10))
ax.plot_surface(xx, yy, zz, alpha=0.5)
# ax.axis("off")
plt.show()
产生这个数字。
右红色箭头太大,是否可以设置其大小,例如head_width
中的ax.arrow
?
所有headlength, headwidth, width
都会收到错误消息AttributeError: Unknown property headwidth
,因此this和this都无法解决此问题。