#8004: region_plot does not handle lambda functions
---------------------------+------------------------------------------------
   Reporter:  jason        |       Owner:  was            
       Type:  defect       |      Status:  positive_review
   Priority:  major        |   Milestone:  sage-4.3.2     
  Component:  graphics     |    Keywords:                 
     Author:  Jason Grout  |    Upstream:  N/A            
   Reviewer:               |      Merged:                 
Work_issues:               |  
---------------------------+------------------------------------------------
Changes (by rossk):

  * status:  needs_review => positive_review


Comment:

 Despite a depreciation message, this worked as expected for all the cases
 I tried.

 {{{
 sage: var('x y')
 (x, y)

 sage: region_plot(lambda x,y: x>y, (-4,4), (-4,4)) # works

 sage: region_plot([lambda x,y: x>y, lambda x,y: x^2+y^2<10], (-4,4),
 (-4,4)) # a list of lambdas also work

 #
 # Tried mixing the forms of the functions (one being a lamba and one an
 expression)
 # - got a depreciation message! (But still displayed the plot correctly)
 #
 sage: region_plot([lambda x,y: x>y, x^2+y^2<10], (-4,4), (-4,4))
 /home/ross/sage-4.3.2.alpha0/local/lib/python2.6/site-
 packages/sage/plot/contour_plot.py:569: DeprecationWarning: Unnamed ranges
 for more than one variable is deprecated and will be removed from a future
 release of Sage; you can used named ranges instead, like (x,0,2)
   g, ranges = setup_for_eval_on_grid(f, [xrange, yrange], plot_points)

 # ...but parentheses also produced the same plot correctly without the
 message
 sage: region_plot([(lambda x,y: x>y), (x^2+y^2<10)], (-4,4), (-4,4))

 # tried the former example again - no depreciated message this time (!?)
 # (Does sage only show depreciations once?)
 sage: region_plot([lambda x,y: x>y, x^2+y^2<10], (-4,4), (-4,4))

 # this worked too
 sage: region_plot([lambda x,y: x>y, lambda x,y: x^2+y^2<10], (-4,4),
 (-4,4), aspect_ratio=1)
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8004#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