我试着在三条线上创建曲面投掷。 每条线定义为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
Y, X = np.meshgrid(Y, X)
ax.plot_wireframe( X, Y, Z)
plt.show()
我得到了这个图像
但我需要这样的图像:
我的问题解决了。你知道吗
相关问题 更多 >
编程相关推荐