Ask Your Question

Set axes in 3d plot

asked 2012-05-23 09:57:23 -0600

calc314 gravatar image

Is there a way to set the kind of axes shown in a 3d plot? Seems like you should be able to specify boxed, axes, etc. in the show command.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-05-24 22:39:41 -0600

ndomes gravatar image

You can write your own python function to draw axes, something like:

def axes(xmin=-1,xmax=1,ymin=-1,ymax=1,zmin=-1,zmax=1,**kwds):
    ex = vector((1,0,0))
    ey = vector((0,1,0))
    ez = vector((0,0,1))
    G =  line3d([xmin*ex,xmax*ex],**kwds)
    G += line3d([ymin*ey,ymax*ey],**kwds)
    G += line3d([zmin*ez,zmax*ez],**kwds)
    return G

edit flag offensive delete link more

answered 2012-05-23 16:25:49 -0600

kcrisman gravatar image

You can do frame=False and axes=True, but doubtless you're talking about something more substantial, and these leave ... less than desirable results. I'm not sure why the axes are in the wrong place sometimes, though I believe there is a ticket open for this.

edit flag offensive delete link more


Thanks for the help. I really went a few rounds with the plot3d options this afternoon and ended up using the line command to create some axes. Just wanted to make sure I hadn't missed something in the documentation somehow.

calc314 gravatar imagecalc314 ( 2012-05-23 17:25:29 -0600 )edit

That's probably what I would do at this point too. It would be great to have a nice axes option for 3d graphics.

Jason Grout gravatar imageJason Grout ( 2012-05-24 06:10:09 -0600 )edit

See for a belated followup ticket.

kcrisman gravatar imagekcrisman ( 2015-10-20 13:33:08 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-05-23 09:57:23 -0600

Seen: 647 times

Last updated: May 24 '12