Mike Witt wrote:
> On 08/21/2008 06:55:48 PM, Joel B. Mohler wrote:
>> On Thursday 21 August 2008 01:58:23 pm Mike Witt wrote:
>>> I'm looking for a work-around for the situation where I would normally
>>> call parametric_plot (or plot, for that matter) with a function, and in
>>> some particular case that function turns out to evaluate to a constant.
>>>
>>> For example:
>>>
>>> sage: def f(a,b): return e^(a+b*I)
>>> ....:
>>> sage: parametric_plot([real(f(x,1)),imag(f(x,1))], -pi, pi)
>>>
>>>   Works as expected
>>>
>>> sage: parametric_plot([real(f(x,-1)),imag(f(x,-1))], -pi, pi)
>>>
>>>   Works as expected
>>>
>>> sage: parametric_plot([real(f(x,0)),imag(f(x,0))], -pi, pi)
>>>
>>>   Gives a page full of errors, which I interpret to mean that there
>>>   was a problem plotting because imag(f(x,0)) evaluates to a constant.
>>>
>>> I believe that this is the same issue described in:
>>>
>>> http://trac.sagemath.org/sage_trac/ticket/2410
>> I'm the person that entered the trac ticket and the point of that trac 
>> ticket 
>> is precisely the (mis-)functionality you are describing.   I'm truly 
>> mystified by the other responses in this thread.  To me, this is an obvious 
>> bug...
>>
>> --
>> Joel
> 
> Thanks Joel. I was beginning to wonder if I was nuts. Just to summarize what
> I've found out so far. The work-arounds suggested by David Joyner, Mike 
> Hansen, 
> and Carl Witty all work under certain assumptions, but none of the three
> provides a completely general fix as far as I can see. Using a combination of
> the techniques I am able to do what I want. But I am for whatever it's worth
> I'd certainly like to add my vote that tickets #2409 and #2410 should get
> attention. This issue with parametric_plot is certainly *very* confusing
> to a newcomer.


Here's yet another method:

sage: from  sage.ext.fast_eval import fast_float
sage: plot(fast_float(1), -1, 2)
sage: parametric_plot((fast_float(1),t),-12,12)


Now, why in the world the plot functions aren't calling fast_float, I 
don't know.  I thought that's what they did.  I'm looking into it for a 
few minutes, at least.

Jason


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to