#12881: Allow plotting zero width interval
-------------------------------+--------------------------------------------
       Reporter:  kcrisman     |         Owner:  jason, was
           Type:  enhancement  |        Status:  new       
       Priority:  minor        |     Milestone:  sage-5.1  
      Component:  graphics     |    Resolution:            
       Keywords:               |   Work issues:            
Report Upstream:  N/A          |     Reviewers:            
        Authors:               |     Merged in:            
   Dependencies:               |      Stopgaps:            
-------------------------------+--------------------------------------------
Changes (by kcrisman):

  * type:  defect => enhancement


Old description:

> {{{
> plot(x,x,0,0)
>
> Traceback (click to the left of this block for traceback)
> ...
> ZeroDivisionError: float division
> }}}
> Maybe this should be an error, but it should be an ''informative'' error.

New description:

 {{{
 plot(x,x,0,0)

 Traceback (click to the left of this block for traceback)
 ...
 ValueError: plot start point and end point must be different
 }}}
 Maybe this shouldn't be an error, but instead give an empty plot or a
 point?  See below for discussion.

--

Comment:

 Oh, and this is clearly a dup '''and''' invalid as it stands, because I
 was using our old campus server.  Nice!

 But I'm going to change this.  I wonder if this maybe shouldn't give rise
 to an empty graphic, or maybe just a point.  The reason is that in the
 wild, one can't always predict what one will want.  As an example:
 {{{
 var('y')
 @interact
 def _(t = [pi/6*n for n in [1..18]]):
     P = plot(1/2*sin(y),(x,0,t),fill=True,tick_formatter=pi,ticks=pi/6)
     Q = plot(1/2*sin(y),(x,0,3*pi),tick_formatter=pi,ticks=pi/6)
     show(P+Q)
     html("The integral up to $y=%s$ is $\\approx
 %s$."%(latex(t),latex(integral(1/2*sin(y),y,0,t).n())))
 }}}
 I would really ''like'' to have it be from `[0..18]`, since I already have
 a plot and it would be nice to have this work since integration from 0 to
 0 works - but this error stands in the way.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12881#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
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-trac?hl=en.

Reply via email to