Juan Chô
Juan Chô

Reputation: 572

3d plot without wire coordinates

I am using python matplotlib for drawing a 3d surface. I'd like to draw only the surface and not the underlying coordinates grid which appears on each plane. Here's my code:

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm

nb = 40
Z = np.random.randn(nb, nb)
Z = np.absolute(Z)
fig = plt.figure()
ax = fig.gca(projection='3d')
X = Y = np.arange(1., nb+1, 1)
X, Y = np.meshgrid(X, Y)

ax.plot_surface(X, Y, Z, cmap = cm.coolwarm,  inewidth = 0, antialiased=True)
ax.view_init(azim=45)
ax.grid(b=False)                                                                                                                      
plt.grid(b=False)
plt.show()

But the graphic still show the wire coordinates wired image

How can I get ride of these? I tryed grid(b=False) but dont worked.

Upvotes: 0

Views: 222

Answers (1)

Remove this line

plt.grid(b=False)

and it should work fine.

enter image description here

Upvotes: 1

Related Questions