Python 在matplotlib中创建曲面

Python 在matplotlib中创建曲面,python,matplotlib,Python,Matplotlib,我尝试在3条线上创建曲面投掷。 每条线定义在3个点中(每个点具有坐标(x、y、z)) 第一行: (0, 0, 10) (0, 5, 5) (0,10,2) 第二行: (2, 0, 10) (2, 5, 5) (2,10,2) 第三行: (4, 1, 10) (4, 6, 5) (4、11、2) 我得到了这个图像 但我需要这样的图像: 我的问题解决了 from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from ma

我尝试在3条线上创建曲面投掷。 每条线定义在3个点中(每个点具有坐标(x、y、z))

第一行: (0, 0, 10) (0, 5, 5) (0,10,2)

第二行: (2, 0, 10) (2, 5, 5) (2,10,2)

第三行: (4, 1, 10) (4, 6, 5) (4、11、2)

我得到了这个图像

但我需要这样的图像:
我的问题解决了

from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

x = [0, 2, 4, 0, 2, 4, 0, 2, 4]
y = [0, 0, 1, 5, 5, 6, 10, 10, 11]
z = [10, 10, 10, 5, 5, 5, 2, 2, 2]

X = x
Y = y
Z = z

ax.plot_trisurf( X, Y, Z)
plt.show()

from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

x = [0, 2, 4, 0, 2, 4, 0, 2, 4]
y = [0, 0, 1, 5, 5, 6, 10, 10, 11]
z = [10, 10, 10, 5, 5, 5, 2, 2, 2]

X = x
Y = y
Z = z

ax.plot_trisurf( X, Y, Z)
plt.show()