On Apr 16, 12:49 am, "D. S. McNeil" <[email protected]> wrote:
> > I'm not turning off warnings in numpy, though, since we use it under the 
> > hood only
> > here.
>
> I'm confused.  I was going to recommend numpy.seterr(all='ignore')
> before I read this, maybe wrapping plot to restore the original state
> after the call..  but now I'm not sure what kind of solution you want.
>  :^)

That was exactly my thought, that this is inappropriate.

> In this case, the problem is being caused by the default parameters in
> plot_slope_field.  If you override headlength=0 with some small
> number, there's no problem.  IOW,
>
> P=plot_slope_field(g,(x,3,4),(y,-1,1),headlength=1e-8)
>
> works for me.  FYI, it's the following few lines in Quiver._h_arrows at fault:
>
>         minsh = self.minshaft * self.headlength
>         [....]
>         shrink = length/minsh
>         X0 = shrink * X0[np.newaxis,:]
>         Y0 = shrink * Y0[np.newaxis,:]
>
> Probably we should change the defaults and/or (if it's not done
> already) ask our matplotlib friends to special-case 0 for no
> arrowheads.
>
> Does that help?

Nice catch!  So it wasn't what I thought (though I admit I didn't have
time to actually look at the backtrace much).  I had to use Sage 4.4.4
today in a talk just to avoid this.   Since it's a warning, it
wouldn't show up in doctesting as a failure.

Yes, it would be worth posting this as a pure pylab example (which I
don't quite know how to do it as, naturally) upstream.  See
http://trac.sagemath.org/sage_trac/ticket/11208 (and also
http://trac.sagemath.org/sage_trac/ticket/2922, which is tangentially
related).

- 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

Reply via email to