#6811: [with patch; needs review] prime_pi.plot is wrong (!)
---------------------------+------------------------------------------------
 Reporter:  was            |       Owner:  was       
     Type:  defect         |      Status:  new       
 Priority:  critical       |   Milestone:  sage-4.1.2
Component:  number theory  |    Keywords:            
 Reviewer:                 |      Author:            
   Merged:                 |  
---------------------------+------------------------------------------------

Comment(by rohana):

 Looks fine:
  1. Importing sage.plot.all is no longer necessary in prime_pi.pyx
  1. May want to change
 {{{
 for i in range(len(v)):
     w.append(v[i])
     if i+1 < len(v):
         w.append((v[i+1][0],v[i][1]))
 }}}
 to
 {{{
 for i in range(len(v)-1):
     w.append(v[i])
     w.append((v[i+1][0],v[i][1]))
 w.append(v[len(v)-1])
 }}}
 for readability.
  1. The plot_step_function always starts horizontal and ends vertically,
 this can sometimes lead to rather odd looking results in my opinion. For
 example, compare
 {{{
 sage: plot_step_function([(i,i^3) for i in range(6)])
 sage: plot_step_function([(i,i^3) for i in range(6)]) +
 line([(5,125),(6,125)])
 }}}
     a. If we are to make any changes to this, we would need to consider
 uneven intervals of definition (say the function {{{[(i^2,i^3) for i in
 range(6)]}}}).
  1. Might be useful to use the plot_step_function elsewhere. For example,
 with Riemann sums it is either difficult or impossible to enable vertical
 lines, and the floor function is in the opposite situation.

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