#14177: More uniform handling of color_by_labels for graph plot, plot3d, 
graphviz
-------------------------------------+--------------------------------------
       Reporter:  nthiery            |         Owner:  jason, ncohen, rlm
           Type:  enhancement        |        Status:  needs_work        
       Priority:  major              |     Milestone:  sage-5.8          
      Component:  graph theory       |    Resolution:                    
       Keywords:                     |   Work issues:                    
Report Upstream:  N/A                |     Reviewers:  Nathann Cohen?    
        Authors:  Nicolas M. ThiƩry  |     Merged in:                    
   Dependencies:                     |      Stopgaps:                    
-------------------------------------+--------------------------------------

Comment (by nthiery):

 Replying to [comment:3 ncohen]:
 > HMmmmm.... Really ? `:-P`
 > {{{
 > ``color_by_label`` - a boolean (default: False)
 > ...
 > sage: p = G.plot(edge_labels=True, color_by_label={'a':'yellow',
 'b':'purple'}); p
 > }}}

 Yes, really! Just take a slightly larger extract :-)
 {{{
         - ``color_by_label`` - a boolean (default: False)
            whether to color each edge with a different color according
            to its label; this can also take as value a function or
            dictionary mapping labels to colors; this option is
            incompatible with ``edge_color`` and ``edge_colors``.
 }}}

 I agree it's not perfect, as you may at first glance miss the information
 that the value can be something else than a boolean. But I did not find a
 better formulation without being heavy in the formaluation. Better
 suggestions welcome. Maybe something like:
 {{{
         - ``color_by_label`` - a boolean, dictionary or function (default:
 False)
            whether to color each edge with a different color according
            to its label; the value can be a function or
            dictionary mapping labels to colors; this option is
            incompatible with ``edge_color`` and ``edge_colors``.
 }}}



 > This being said, what would you think of a `color_by_label` argument
 that can be set to `False` (all edges receive the same color), to a
 dictionary like you do right now, or to `True`, in which case you can give
 each label a specific color (with `g.edge_labels()` and `rainbow`) ?

 This is exactly what this is doing currently, isn't it?

 Cheers,
                                    Nicolas

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