我有这段代码,但无论我怎么尝试,都无法使网格线变实。它们总是被绘制成虚线:import numpy as np;from matplotlib import cm, colors;import cmath;import matpl...
我有这段代码,但无论我怎么尝试,都无法使网格线变得实心。它们总是被绘制成虚线:
import numpy as np;
from matplotlib import cm, colors;
import cmath;
import matplotlib.pyplot as plt;
from mpl_toolkits.mplot3d import Axes3D;
import scipy.special as sp;
l = 3 # degree
m = 0 # order
PHI, THETA = np.mgrid[0:2*np.pi:300j, 0:np.pi:150j]
R = sp.sph_harm(m, l, PHI, THETA).real
s = 1
X = (s*R*0.28+1) * np.sin(THETA) * np.cos(PHI)
Y = (s*R*0.28+1) * np.sin(THETA) * np.sin(PHI)
Z = (s*R*0.29+1) * np.cos(THETA)
norm = colors.Normalize()
fig, ax = plt.subplots(subplot_kw=dict(projection='3d'), figsize=(14,10))
m = cm.ScalarMappable(cmap=cm.jet)
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=cm.jet(norm(R)))
m.set_array(R)
fig.colorbar(m, shrink=0.8);
在 matplotlib 中是否可以绘制实线而不是虚线网格线?
下载声明:
本站所有软件和资料均为软件作者提供或网友推荐发布而来,仅供学习和研究使用,不得用于任何商业用途。如本站不慎侵犯你的版权请联系我,我将及时处理,并撤下相关内容!