#4342: [with patch; negative review] Add legends to plot.py
-------------------------+--------------------------------------------------
 Reporter:  anakha       |        Owner:  anakha  
     Type:  enhancement  |       Status:  assigned
 Priority:  major        |    Milestone:  sage-3.4
Component:  graphics     |   Resolution:          
 Keywords:               |  
-------------------------+--------------------------------------------------
Changes (by wdj):

  * summary:  [with patch; needs review] Add legends to plot.py => [with
              patch; negative review] Add legends to plot.py

Comment:

 The good news is that Mike Hansen's patch does apply cleanly to 3.2.2.

 The bad news is that this patch breaks some basic functionality:

 {{{
 sage: p = plot(tan(x), x, -1/2, 1/2)
 sage: show(p)

 }}}
 raises a TypeError exception.

 That is serious but more serious (to me - maybe this exception is
 an easy-to-fix bug) is the design of this legend functionality.

 It seems to me (and people who know about the Graphics class can hopefully
 correct me if I am wrong) the following is both possible and a fairly
 natural way of writing a legend as another graphics object:

 1. given 2d plot objects P, Q (ie, instances of a Graphics class),
 one could wrote a function which returns
 (a) the functions being plotted in P,Q (resp),
 (b) the line style used in P,Q (resp).
 From this data, one can write a function taking P,Q (and a cnter point)
 as arguments (more generally any list of such plot objects) and returning
 a legend as an analog of a text plot. This can be placed anywhere
 by choosing the center point appropriately.

 I'm happy to change my opinion (since IMHO this added functionality would
 be great),
 especially if someone with more knowledge of the plotting can comment
 positively
 on this. I really greatly appreciate the hard programming work that went
 into this.
 Maybe I'm being naive but the design to me seems a bit awkward, and in any
 case
 it breaks show (which is bad, hence making it a "show stopper", if you
 excuse
 the horribly bad pun).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4342#comment:7>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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