我不知道我的代码有什么问题?

问题描述 投票:0回答:0

它不工作

# importing libraries
from mpl_toolkits import mplot3d
import numpy as np
import mpl_toolkits as plt
# defining surface and axes
x = np.outer(np.linspace(-2, 2, 10), np.ones(10))
y = x.copy().T
z = np.cos(x ** 2 + y ** 3)
fig = plt.figure()
# syntax for 3-D plotting
ax = plt.axes(projection ='3d')
# syntax for plotting
ax.plot_surface(x, y, z, cmap ='viridis', edgecolor ='green')
ax.set_title('surface plot python.hub')
plt.show()

我看了一些 yt 视频,但无法理解

python graph 3d
© www.soinside.com 2019 - 2024. All rights reserved.