On Thursday, June 28, 2012 5:40:25 PM UTC-4, Dan Drake wrote: > > Here's a question about changing the viewpoint in a 3d plot: > > ----- Forwarded message from "Gagnon, Jacob A" ----- > > Thanks. The server is up now. I have quick question about plot3d. If > > you try my interact at http://users.wpi.edu/~jgagnon/sagetest.html > > with parameters 0, 0, 0.75, 2, 2, then the orientations of the contour > > plot and 3d plot are not aligned. How do I make the default > > orientation of the 3d plot be a XY plane view with an additional > > slight rotation about the x axis? I would like to do this > > automatically instead of right click view XY plane and then rotate > > about the x axis with the mouse. > > The relevant code is: > > @interact > def _(mux=slider(-2,2,0.5,default=0,label='mux'),muy=slider(-2,2, > 0.5,default=0, label='muy'),rho=slider(-0.75,.75, 0.25,default=0, > label='rho'),sx=slider(0.1,2, 0.1,default=1, > label='sx'),sy=slider(0.1,2, 0.1,default=1, label='sy')): > f(x,y) = > > 1/(2*pi*sx*sy*sqrt(1-rho^2))*exp(-1/(2*(1-rho^2))*((x-mux)^2/sx^2+(y-muy)^2/sy^2-2*rho*(x-mux)*(y-muy)/sx/sy)) > > > g(x)=f(y=0) > h(y)=f(x=0) > p1=contour_plot(f(x,y),(x,-5,5),(y,-5,5),cmap='hsv') > p2=plot3d(f(x,y),(x,-5,5),(y,-5,5)) > p3=plot(g(x),(x,-5,5)) > p4=plot(h(y),(y,-5,5)) > show(p1,figsize=3) > show(p2,figsize=3) > > > Do we have a way of specifying a viewpoint when doing a 3d plot? > > I thought I answered this to some extent in the same thread you took this from? At least in Jmol,
show(p2,figsize=3,orientation=(0,0,0,0)) rotates around the (0,0,0) axis by 0 degrees. See http://biology.kenyon.edu/BMB/jmodel/Jmol_projects_2007.html and search for "moveto". I don't understand how Tachyon's works from within Sage, but it is very customizable, I know. Maybe the tachyon interface has examples? Unfortunately, these keywords only work in show. See http://trac.sagemath.org/sage_trac/ticket/9708 If someone knows even easier ways of doing these things, though, or is interested in documenting this better (!!!!) we'd be all ears! - kcrisman -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
