#14037: plot of piecewise defined function raises UnboundLocalError
------------------------+---------------------------------------------------
   Reporter:  slabbe    |             Owner:  jason, was
       Type:  defect    |            Status:  new       
   Priority:  major     |         Milestone:  sage-5.7  
  Component:  graphics  |          Keywords:            
Work issues:            |   Report Upstream:  N/A       
  Reviewers:            |           Authors:            
  Merged in:            |      Dependencies:            
   Stopgaps:            |  
------------------------+---------------------------------------------------
 This was reported to me by Mathieu Roux:

 {{{
 sage: f = piecewise([[(0,1),1],[(1,2),x-1]],x)
 sage: plot(f,0,2)
 verbose 0 (575: plot.py, plot) there were 4 extra arguments (besides
 <sage.ext.fast_eval.FastDoubleFunc object at 0xb912618>)
 ---------------------------------------------------------------------------
 UnboundLocalError                         Traceback (most recent call
 last)

 ...

 /Users/slabbe/Applications/sage-5.6.rc0/local/lib/python2.7/site-
 packages/sage/plot/plot.pyc in plot(funcs, *args, **kwds)
    1117             sage.misc.misc.verbose("there were %s extra arguments
 (besides %s)" % (n, funcs), level=0)
    1118
 -> 1119     G._set_extra_kwds(G_kwds)
    1120     if do_show:
    1121         G.show()

 UnboundLocalError: local variable 'G' referenced before assignment
 }}}

 It seems related to a problem cited on
 [https://groups.google.com/forum/?fromgroups=#!topic/sage-
 support/920l9d7covs sage-support] in 2008.

 Note that the following works:

 {{{
 sage: f.plot()
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14037>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to