On Jan 4, 2008 2:31 PM, Jaap Spies <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I just tried to mimic the mlab session at:
> http://gael-varoquaux.info/blog/?p=3
>
> With some tricks you can do this in sage, if you have the experimental
> ETS installed :)
>
> [EMAIL PROTECTED] sage-2.8.15]$ ./sage -sh
> Starting subshell with Sage environment variables set:
> [EMAIL PROTECTED] sage-2.8.15]$ which ipython
> ~/downloads/sage-2.8.15/local/bin/ipython
> [EMAIL PROTECTED] sage-2.8.15]$ ipython -wthread
> sage: from enthought.mayavi.tools import mlab as M
> Set Envisage to use the workbench UI: True
> Set Envisage to use the workbench UI: True
> sage: from numpy import *
> sage: f = lambda x, y: sin(x + y) + sin(2*x - y ) + cos(3*x + 4*y)
> sage: x, y = mgrid[-7:7.05:0.1, -5:5.05:0.05]
> sage: M.surf(x, y, f)
>
> (python:17616): Gtk-CRITICAL **: gtk_widget_set_colormap: assertion 
> `!GTK_WIDGET_REALIZED (widget)' failed
> Warning: invalid value encountered in divide
>   _5 = <enthought.mayavi.modules.surface.Surface object at 0xb55a47c>
> sage: M.axes()
>   _6 = <enthought.mayavi.modules.axes.Axes object at 0xabdc68c>
> sage: M.title('Demoing mlab.surf')
>   _7 = <enthought.mayavi.modules.text.Text object at 0xb56ea4c>
> sage: M.
> M.axes                   M.imshow                 M.test_contour3d         
> M.test_quiver3d
> M.clf                    M.mesh                   M.test_contour_surf      
> M.test_quiver3d_2d_data
> M.colorbar               M.outline                M.test_fancy_mesh        
> M.test_simple_surf
> M.contour3d              M.plot3d                 M.test_flow              
> M.test_surf
> M.contour_surf           M.points3d               M.test_imshow            
> M.title
> M.draw                   M.quiver3d               M.test_mesh              
> M.vectorbar
> M.figure                 M.roll                   M.test_mesh_sphere       
> M.view
> M.flow                   M.savefig                M.test_molecule          
> M.xlabel
> M.gcf                    M.scalarbar              M.test_plot3d            
> M.ylabel
> M.get_mayavi             M.surf                   M.test_points3d          
> M.zlabel
> sage: M.surf?
> sage: mgrid?
> sage:
>
>
> The Enthought Tools Suite will be reorganized (seems), so maybe it will be 
> feasible
> to install tvtk, mayavi2 and some dependencies, see
> https://svn.enthought.com/enthought/wiki/EtsProjectRefactor
>
> Looks good to me!

Cool. thanks.  For comparison here's how to do that example using
Sage's integrated 3d graphics (both in the notebook and on the command
line), which we're (me and Robert Bradshaw)
are about to release.  In each screenshot you can dynamically rotate
the graphic around with the mouse.

http://sage.math.washington.edu/home/was/tmp/picture_1.png
http://sage.math.washington.edu/home/was/tmp/picture_2.png

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to