Re: [MayaVi-users] weird behavior of warp_scale='auto' in mlabs surf() function
Status: Beta
Brought to you by:
prabhu_r
From: Gael V. <gae...@no...> - 2009-05-26 15:45:07
|
On Tue, May 26, 2009 at 03:46:54PM +0200, Rohrhirsch, Jakob wrote: > I hope this is the right place for my question. It is. The enthought-dev mailing-list (https://mail.enthought.com/mailman/listinfo/enthought-dev) may also be useful, as it has more traffic, and thus more people to help you. > As far as I understood this, > the warp_scale='auto' option in mlab's surf() function is supposed to scale > the z-axis to a reasonable ratio. Following is a script that demonstrates a > problem I have found: > from numpy import * > from enthought.mayavi.mlab import * > epsilon = 100 > x, y = mgrid[-10.05:10.05:0.1,-10.05:10.05:0.1] > U = epsilon / sqrt(x**2+y**2) > s = surf(x,y,U,warp_scale='auto') > show() > Now if you change the value of epsilon the image acts in a very weird way. If > epsilon is 1 or 10 it seems to be ok (ratio of ~2/3). If it's 100 the peak is > very low. If it's higher than that (1 000, 10 000), the peak is starting to > rise again. is this a numerical problem I'm experiencing here, or is this > indeed a bug in mayavi? Help would be very much apprecheated. This is a bug! Thanks for reporting it. I have fixed it in svn, https://svn.enthought.com/enthought/changeset/23682 You can work around it by using the extent keyword argument. It is not as handy as setting warp_scale to 'auto', but if you don't want to install svn or patch your local version, this is a way forward. Cheers, Gaël |