"Thomas =?iso | 28 Jul 02:00

Re: Modify surf output (axes, scaling)

Hi again. In the ETS 2.8 version (don't know if it was there in the old one as well), there is a "ranges" keyword in the axes function, which lets me arbitrarily set the axes values. So this problem is (not very elegantly, but still) solved.

So, about the other thing (mostly eye-candy :) ) is it possible to produce "smooth" surfaces as with SurfRegular? ( http://i35.tinypic.com/2wnyb2a.png vs http://i37.tinypic.com/2jayljn.png )

Thanks, cheers

Thomas

On Tue, Jul 22, 2008 at 23:10, Thomas Königstein <thkoe002-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Thanks Gael. Pierre already supplied me with a ETS 2.8 build, the decorations.py is identical to the one you attatched in your mail.

Now, the plot looks better in terms of aspect ratio, but the axes don't fit: http://i37.tinypic.com/2jayljn.png <- the values go from 0 to 50, but the axes obviously are too large. (to reconstruct: "from numpy import array;from enthought.mayavi.mlab import surf;surf(array([[x*x+y*y for x in range(-5,5)] for y in range(-5,5)]))" )

Also,is it possible to activate some kind of polynomial/spline interpolation instead of linear? the enthought.tvtk.tools.mlab.SurfRegular method seems to do this: http://i35.tinypic.com/2wnyb2a.png <- the surface looks more "smooth"

Anyways, thanks again, cheers

Thomas




On Fri, Jul 18, 2008 at 16:57, Gael Varoquaux <gael.varoquaux-t+5nXNeJE7o5viHyz3+zKA@public.gmane.org> wrote:
On Fri, Jul 18, 2008 at 10:41:54AM +0200, Thomas Königstein wrote:
>    Hi again. I tried to pass the extent argument to the axes, but as a result
>    the program breaks. Here's what I did:

>    from enthought.mayavi.mlab import surf,axes;from numpy import
>    zeros;g=zeros((5,5));g[0][0]=1e5;plott=surf(g,extent=[0,3,0,3,0,6]);[1]plott.name="p336";axes(name="p336",extent=[0,3,0,3,0,6])

>    Frame Based Inspector says "Exception: 'Axes' object has no attribute
>    'actor'", pointing at the mayvi tools.py (def _set_extent method)

>    Did I miss something?

No :(. This is a bug we fixed recently. I had forgotten about it.

>    And, again, how can I/Pierre from pythonxy update mayavi2 to version
>    2.8? It's not on
>    [2]http://code.enthought.com/enstaller/eggs/windows/xp/ or in the
>    EPD package...

I can't help you here. I don't have a windows box available right now (I
am travelling), and anyhow, I really don't know how to build these
packages under windows. I know Pierre tried, and failed when it came to
building kiva.

What we can do, is try to backport these modifications. I have attached a
"decorations.py", which you should put in you
"python25/lib/site-packages/enthought.mayavi/enthought/mayavi/tools/"
directory (backup the existing decorations.py, just in case this break
everything). Hopefully this will get axes working properly. I haven't had
time to have a look at this closely, and I must run right now.

Cheers,

Gaël



_______________________________________________
Enthought-dev mailing list
Enthought-dev@...
https://mail.enthought.com/mailman/listinfo/enthought-dev

Gmane