gpt4 book ai didi

python - matplotlib 3d 曲面图不显示

转载 作者:行者123 更新时间:2023-11-28 16:33:21 24 4
gpt4 key购买 nike

<分区>

我正在尝试使用 matplotlib 制作一个简单的 3D 表面图,但该图最后没有显示;我只得到空的 3D 轴。

这是我做的:

from mpl_toolkits.mplot3d import Axes3D

x = np.arange(1, 100, 1)
y = np.arange(1, 100, 1)
z = np.arange(1, 100, 1)

fig = figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(x, y, z, rstride=5, cstride=5)
show()

...我明白了: enter image description here

有什么建议吗?

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