import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

delta = 0.2
x = np.arange(-3, 3, delta)
y = np.arange(-3, 3, delta)
X, Y = np.meshgrid(x, y)
Z = X ** 2 + Y ** 2
x = X.flatten()
y = Y.flatten()
z = Z.flatten()

fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_trisurf(x, y, z, cmap=cm.jet, linewidth=0.01)
# plt.contour(X, Y, Z) #注意这里是大写X ,Y,Z
plt.show()
f053e9fa2571f95da9a1c5ab2bf8d7c5f6259bb4
<mask token>

<mask token>
ax.plot_trisurf(x, y, z, cmap=cm.jet, linewidth=0.01)
plt.show()

<mask token>
delta = 0.2
x = np.arange(-3, 3, delta)
y = np.arange(-3, 3, delta)
X, Y = np.meshgrid(x, y)
Z = X ** 2 + Y ** 2
x = X.flatten()
y = Y.flatten()
z = Z.flatten()
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_trisurf(x, y, z, cmap=cm.jet, linewidth=0.01)
plt.show()

import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
delta = 0.2
x = np.arange(-3, 3, delta)
y = np.arange(-3, 3, delta)
X, Y = np.meshgrid(x, y)
Z = X ** 2 + Y ** 2
x = X.flatten()
y = Y.flatten()
z = Z.flatten()
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_trisurf(x, y, z, cmap=cm.jet, linewidth=0.01)
plt.show()

import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

delta = 0.2
x = np.arange(-3, 3, delta)
y = np.arange(-3, 3, delta)
X, Y = np.meshgrid(x, y)
Z = X ** 2 + Y ** 2
x = X.flatten()
y = Y.flatten()
z = Z.flatten()

fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot_trisurf(x, y, z, cmap=cm.jet, linewidth=0.01)
# plt.contour(X, Y, Z) #注意这里是大写X ,Y,Z
plt.show()