尝试在对 plot_surface 的调用中使用 facecolors :
import matplotlib.pyplot as pltimport numpy as npfrom mpl_toolkits.mplot3d import Axes3Dfrom matplotlib import cmfig = plt.figure()ax = fig.add_subplot(111, projection='3d')z = np.array([0,1,2,3,4,5,6,7,8,9,10])radius = np.array([0,1,1.5,1,0,2,4,5,4,2,1])temp = np.array([150,200,210,220,225,220,195,185,160,150,140])angle = np.linspace(0,2*np.pi,20)Z,ANG = np.meshgrid(z,angle)T,ANG = np.meshgrid(temp,angle)# transform them to cartesian systemX,Y = radius*np.cos(ANG),radius*np.sin(ANG)ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=cm.jet(T/float(T.max())))plt.show()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)