问题描述
我想使用 Axes3D.quiver()
在 mplot3d 中绘制多个箭袋箭头。但是,我在每个箭袋箭头中都有多种颜色。 here 指出了类似的问题。
请在下面找到代码和图证据-
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
%matplotlib notebook
x = [1,0]
y = [0,1,0]
z = [0,1]
ax = plt.figure().add_subplot(projection='3d')
# Sending RGB colour sequence
ax.quiver(0,x,y,z,colors=[(1,0),(0,1)])
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
ax.set_xlim(-2,2)
ax.set_ylim(-2,2)
ax.set_zlim(-2,2)
plt.savefig('Question12RGBColours')
plt.cla()
# Sending string colour sequence
ax.quiver(0,colors=['r','g','b'])
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_zlabel('z')
ax.set_xlim(-2,2)
plt.savefig('Question12StringColours')
鉴于 quiver 的文档说任何额外的关键字参数都委托给 LineCollection,因此将两种颜色序列作为参数依次传递。结果是
和
那么有什么方法可以消除这种情况并在 3d 中实现不同颜色的箭袋箭头。请注意 2d quiver plot 没有显示这个问题。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)