-1

How can i make the x and y axes invisible?

the function i found does not work

this is an extract of what i got:

....

fig = plt.figure()
ax = fig.gca(projection='3d')

ax.plot_trisurf(x, y, z,vmin=z.min(), vmax=z.max(), cmap=cm.jet, linewidth=0,   antialiased=False )

plt.title('3D Beam',fontsize=16)

ax.set_zlabel('Z Label Messwerte[V]',fontsize=12)
ax.axes.get_xaxis().set_visible(False)       #x-axis invisible
ax.axes.get_yaxis().set_visible(False) 

....      

think it´s just a small change but somehow i dont get it! i hope somebody can help me

SamsungG
  • 73
  • 1
  • 1
  • 3

1 Answers1

0

Try this:

ax.grid(False)
for a in (ax.w_xaxis, ax.w_yaxis):
    for t in a.get_ticklines()+a.get_ticklabels():
        t.set_visible(False)
    a.line.set_visible(False)
    a.pane.set_visible(False)
Igor Pejic
  • 3,658
  • 1
  • 14
  • 32