我试图运行您的代码,但是在我的计算机上无法运行。
在下面,您可以看到绘制球体的解决方案。基本上,我
alpha=0用手将窗格和刺的颜色变成了彩色,并使刻度线成为空列表(如您所指出的)。
from mpl_toolkits.mplot3d import axes3dimport matplotlib.pyplot as pltfrom matplotlib import rcParamsimport numpy as nprcParams['axes.labelsize'] = 18rcParams['font.family'] = 'serif'rcParams['font.serif'] = ['Computer Modern Roman']rcParams['text.usetex'] = Truefig = plt.figure()ax = fig.add_subplot(111, projection='3d')u = np.linspace(0, 2 * np.pi, 100)v = np.linspace(0, np.pi, 100)x = 10 * np.outer(np.cos(u), np.sin(v))y = 10 * np.outer(np.sin(u), np.sin(v))z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))ax.plot_surface(x, y, z, rstride=4, cstride=4, color='b')# Get rid of the panesax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))ax.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))ax.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0))# Get rid of the spinesax.w_xaxis.line.set_color((1.0, 1.0, 1.0, 0.0))ax.w_yaxis.line.set_color((1.0, 1.0, 1.0, 0.0))ax.w_zaxis.line.set_color((1.0, 1.0, 1.0, 0.0))# Get rid of the ticksax.set_xticks([]) ax.set_yticks([]) ax.set_zticks([])# Add the labelsax.set_xlabel('Third dimension' )ax.set_ylabel('Row(s)')ax.set_zlabel('Column(s)')plt.show()这是我的输出



