I tried to run your pre, but it is not working in my computer.
Below you can see a solution for plotting a sphere. Basically, I turned the
color of the panes and spines to
alpha=0by hand and make the ticks to be
empty lists (as you pointed out).
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()
And here is my output
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)