[英]Changing the background color of the axes planes of a matplotlib 3D plot
使用相同的示例。 您可以使用set_pane_color
方法设置窗格颜色,如http://matplotlib.org/mpl_toolkits/mplot3d/api.html#axis3d 所述。 您可以使用 RGBA 元组设置颜色:
# scatter3d_demo.py
# ...
# Set the background color of the pane YZ
ax.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 1.0))
plt.show()
对于稍微不同的方法,请参见下文:
# Get rid of colored axes planes
# First remove fill
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
# Now set color to white (or whatever is "invisible")
ax.xaxis.pane.set_edgecolor('w')
ax.yaxis.pane.set_edgecolor('w')
ax.zaxis.pane.set_edgecolor('w')
# Bonus: To get rid of the grid as well:
ax.grid(False)
请参阅我用作来源的这篇博文。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.