如何解决如何比较 Python 中的两个 3D 图?
我想在 Python 中比较两个 Matplotlib 3D 图:
import matplotlib.pyplot as plt
colors = ["orange","blue","black","green","red","cyan","magenta","gold"]
x = [1,2,3,4,5,6,7,8,9]
y = [1,9]
z = [1,9]
z2 = [9,1]
fig1 = plt.figure()
ax1 = fig1.gca(projection="3d")
fig2 = plt.figure()
ax2 = fig2.gca(projection="3d")
fig3 = plt.figure()
ax3 = fig3.gca(projection="3d")
for i in range(0,8):
ax1.plot([x[i],x[i+1]],[y[i],y[i+1]],[z[i],z[i+1]],color=colors[i])
ax2.plot([x[i],color=colors[i])
ax3.plot([x[i],[z2[i],z2[i+1]],color=colors[i])
fig1.show()
fig2.show()
fig3.show()
print(fig1 == fig2,fig1 == fig3,fig2 == fig3)
print(ax1 == ax2,ax1 == ax3,ax2 == ax3) # Tried with "ax" just to see if it would work.
我的代码显示了三个数字:
- 图 1(左)
- 图 2(右上角)
- 图 3(右下)
输出:
print(fig1 == fig2,ax2 == ax3) # Tried with "ax" just to see if it would work.
是:
False False False
False False False
但图 1 和图 2 是相同的。只有图 3 不同。我期待输出:
True,False,False
True,False
帮助?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。