On Tuesday 05 December 2006 02:43, William Stein wrote:
> >>> f = sin(x) should be illegal (though I'm not sure how to throw an
> >>> informative error here).
>
> That means writing "sin(x)" is illegal, so
>
>    show(plot(sin(x)))
>
> is illegal

I realize that some of the things that Robert & I are saying would make the 
above plot much more complicated to generate (personally, the result of that 
plot command is near useless so I'm not sure I care, but it's nice to have 
default bounds I guess).  However, I think that if the above plot command 
works, the following should also:

sage: show(plot(1))
---------------------------------------------------------------------------
<type 'exceptions.ValueError'>            Traceback (most recent call last)

/home/joel/<ipython console> in <module>()

/home/joel/sage-1.5.alpha6/local/lib/python2.5/site-packages/sage/plot/plot.py 
in __call__(self, funcs, xmin, xmax, parametric, polar, show, **kwds)
   2096                 data.append((x, float(y)))
   2097             except (TypeError, ValueError), msg:
-> 2098                 raise ValueError, "Unable to compute f(%s)"%x
   2099         # adaptive refinement
   2100         i, j = 0, 0

<type 'exceptions.ValueError'>: Unable to compute f(-0.99139086463)
*****************************************************************************

My suggestion for a fix is that the input to plot command should be coerced to 
a function of one variable and then evaluated.  Constants would, of course, 
be coerced to the constant function.

--
Joel

--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to