#7570: Make plot methods accept 'empty' input to return empty Graphics object
----------------------------------------+-----------------------------------
   Reporter:  chapoton                  |       Owner:  was                
       Type:  defect                    |      Status:  needs_review       
   Priority:  minor                     |   Milestone:  sage-4.6.2         
  Component:  graphics                  |    Keywords:  list_plot, beginner
     Author:  Ryan Grout                |    Upstream:  N/A                
   Reviewer:  Aly Deines, Gagan Sekhon  |      Merged:                     
Work_issues:  commit message, sphinx    |  
----------------------------------------+-----------------------------------
Changes (by kcrisman):

  * status:  needs_work => needs_review


Old description:

> list_plot does not accept '''empty''' lists:
>
> {{{
> list_plot([1],rgbcolor=(1,0,0))+list_plot([],rgbcolor=(0,0,1))
>
> IndexError: list index out of range
> }}}
>
> does not work, whereas
>
> {{{
> list_plot([1],rgbcolor=(1,0,0))+list_plot([2],rgbcolor=(0,0,1))
> }}}
>
> does work. It would be nicer if list_plot of empty lists gives an empty
> graphics object.
>
> '''Apply''': [attachment:trac_7570_empty_graphics.2.patch]

New description:

 list_plot does not accept '''empty''' lists:

 {{{
 list_plot([1],rgbcolor=(1,0,0))+list_plot([],rgbcolor=(0,0,1))

 IndexError: list index out of range
 }}}

 does not work, whereas

 {{{
 list_plot([1],rgbcolor=(1,0,0))+list_plot([2],rgbcolor=(0,0,1))
 }}}

 does work. It would be nicer if list_plot of empty lists gives an empty
 graphics object.

 '''Apply''': [attachment:trac_7570_empty_graphics.2.2.patch]

--

Comment:

 I think this fixes both issues, as well as corrects several 'emtpy'
 occurrences.

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