gpt4 book ai didi

python - Python 中的 3D 图

转载 作者:太空宇宙 更新时间:2023-11-04 09:07:10 26 4
gpt4 key购买 nike

如何在 3 维中绘制以下数据? (显然,还有更多!)

data = [[10, 10, 0.84496124031007758],
[10, 20, 0.87209302325581395],
[10, 30, 0.88139534883720927],
[20, 10, 0.86201550387596892],
[20, 20, 0.87441860465116272],
[20, 30, 0.88992248062015500],
[30, 10, 0.87984496124031009],
[30, 20, 0.89922480620155043],
[30, 30, 0.92015503875968996]]

最佳答案

你想要什么样的情节?试试这个散点图。我还假设您的数据列在您问题的 x,y,z 列表中。

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

x, y, z = zip(*data)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(x,y,z)
plt.show()

关于python - Python 中的 3D 图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19280818/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com