nkint
nkint

Reputation: 11733

Plotting surface without axes

I want to plot a surface without axes planes.. I think I'll explain better with images:

I want to get whis one:

desirerd

Instead, I'm getting this:

current

Upvotes: 3

Views: 2863

Answers (3)

David
David

Reputation: 106

This one disables all the axes stuff:

ax.grid(False)
for a in (ax.w_xaxis, ax.w_yaxis, ax.w_zaxis):
    for t in a.get_ticklines()+a.get_ticklabels():
        t.set_visible(False)
    a.line.set_visible(False)
    a.pane.set_visible(False)

Upvotes: 6

Paul
Paul

Reputation: 43620

After much beating of head against wall, I was able to come up with this:

ax.grid(False)
ax.w_xaxis._AXINFO['y']['color'] = (0.9, 0.9, 0.9, 0.0)
ax.w_xaxis._AXINFO['x']['color'] = (0.9, 0.9, 0.9, 0.0)
ax.w_xaxis._AXINFO['z']['color'] = (0.9, 0.9, 0.9, 0.0)

Next, i bet you'll want the ticks, ticklabels, etc, turned off. I can't do it!

One would think that ax.axis("off"), ax.xaxis.visible(False), ax.xaxis.set_alpha(0.0) would do something noticeable.

I'm using version 1.0.1 and I'm suspecting there are still a lot of bugs in the axis3d object. It's seen a lot of changes lately.

enter image description here

Upvotes: 3

JoshAdel
JoshAdel

Reputation: 68682

What you want is the grid keyword (if I understood the question correctly):

fig=figure()
ax = fig.add_subplot(111,projection="3d")
ax.plot(X,Y,Z)
ax.grid(on=False)
show()

It would help to see how you are setting up your plot, but at least for me messing around in pylab, ax.grid(on=False) did the trick. This turns off the grid projected onto the sides of the cube. See the mplot3d API for more details:

http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/api.html

Upvotes: 2

Related Questions