ys = np.tile(y, (rows,1))
zs = z.repeat(cols).reshape((rows,cols))
theta = np.linspace(0, 2*np.pi, 18, endpoint=False)
x = r*np.cos(theta)
y = r*np.sin(theta)
x[2::3] = x[1::3]
x[1::3] = 0
y[2::3] = y[1::3]
y[1::3] = 0
z = np.ones(18) * h * 0.9
vs = np.stack((x,y,z), axis=1)
plt.mesh(xs, ys, zs, im[::-1])
plt.surface(vs, color=‘#C03000’, method=‘T’, mode=‘FCBC’, alpha=0.8)
plt.sphere((0,0,h*0.4), 0.4, ‘#FFFFFF’, slices=60, mode=‘FCBC’)
plt.plot((0,0), (0,0), (0.4h, 1.5h), width=3.0, style=‘solid’, cmap=‘hsv’, caxis=‘z’)
plt.show(rotation=‘h-’)
运行结果(会动的哦):
一、Python所有方向的学习路线
Python所