简体   繁体   中英

mplot3d: how to show the ticks but not the grids?

I want to show the axis ticks with matplotlib/mplot3d but not the faint grids on the x/y/z background:

在此处输入图片说明

Is there a way to suppress the grids?

Calling ax.grid(False) should suffice. Self contained example, adding that line to this :

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.grid(False)
X, Y, Z = axes3d.get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

plt.show()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM