在 Matplotlib 中绘制平面时,我没有得到纯色。我得到以下带有许多红色阴影的信息:
我在 Python 3.5.2 中使用 Matplotlib 版本 1.5.1。我正在运行的代码如下:
import numpy as np
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
xaxis = np.linspace(-3, 3, 201)
yaxis = np.linspace(-3, 3, 201)
X, Y = np.meshgrid(xaxis, yaxis)
Z = 8 - 3*X - 3*Y
ax.plot_surface(X,Y,Z,color='r')
plt.savefig('not_red.png')
最佳答案
如果您不想要任何阴影,解决方案是设置 shade=False
:
ax.plot_surface(X,Y,Z,color='r', shade=False)
关于python - Matplotlib 表面颜色不纯,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48432738/