#13891: Default parameters for Graph.plot() and Graph.show()
---------------------------------+------------------------------------------
       Reporter:  ncohen         |         Owner:  jason, ncohen, rlm           
         
           Type:  enhancement    |        Status:  needs_review                 
         
       Priority:  major          |     Milestone:  sage-5.7                     
         
      Component:  graph theory   |    Resolution:                               
         
       Keywords:                 |   Work issues:                               
         
Report Upstream:  N/A            |     Reviewers:  Punarbasu Purkayastha, 
Sébastien Labbé
        Authors:  Nathann Cohen  |     Merged in:                               
         
   Dependencies:  #13862         |      Stopgaps:                               
         
---------------------------------+------------------------------------------

Old description:

> Some cleaning there, and some doc, ... and a way for me to define a
> default size for Graph plots, even if I am not allowed to hardcode it in
> Sage because of the notebook.
>
> Here are the new lines in my init.sage file :
>
> {{{
> import sage.graphs.graph_plot
> sage.graphs.graph_plot.default_show_options['figsize'] = 15
> }}}
>
> Hell Yeahhhhhhhhhhhhhhhhhhh !! `:-P`
>
> Nathann

New description:

 Some cleaning there, and some doc, ... and a way for me to define a
 default size for Graph plots, even if I am not allowed to hardcode it in
 Sage because of the notebook.

 Here are the new lines in my init.sage file :

 {{{
 import sage.graphs.graph_plot
 sage.graphs.graph_plot.default_show_options['figsize'] = 15
 }}}

 Hell Yeahhhhhhhhhhhhhhhhhhh !! `:-P`

 Nathann

 ----
 Apply to devel/sage
 1. [attachment:trac_13891.patch]
 2. [attachment:trac_13891-second_pass.patch]
 3. [attachment:trac_13891-third_pass.patch]

--

Comment (by ppurka):

 This started out as a small patch, but it became quite big already!
 Anyway, my original fears are all gone. Things seem to work just fine :) I
 have just a bunch of minor comments now (waiting for the documentation to
 build):
 1. There is a doctest error
 {{{
 File "/home/punarbasu/Installations/sage-5.7.beta0/devel/sage-
 main/sage/graphs/generic_graph.py", line 13803:
     sage: list(sorted(layout_options.iteritems()))
 Expected:
     [('by_component', 'Whether to do the spring layout by connected
 component -- a boolean.'),
      ('dim', 'The dimension of the layout -- 2 or 3.'),
      ('heights', 'A dictionary mapping heights to the list of vertices at
 this height.'),
      ('iterations', 'The number of times to execute the spring layout
 algorithm.'),
      ('layout', 'A layout algorithm -- one of "acyclic", "circular",
 "ranked", "graphviz", "planar", "spring", or "tree".'),
      ('prog', 'Which graphviz layout program to use -- one of "circo",
 "dot", "fdp", "neato", or "twopi".'),
      ('save_pos', 'Whether or not to save the computed position for the
 graph.'),
      ('spring', 'Use spring layout to finalize the current layout.'),
      ('tree_orientation', 'The direction of tree branches -- "up" or
 "down".'),
      ('tree_root', 'A vertex designation for drawing trees.')]
 Got:
     [('by_component', 'Whether to do the spring layout by connected
 component -- a boolean.'), ('dim', 'The dimension of the layout -- 2 or
 3.'), ('heights', 'A dictionary mapping heights to the list of vertices at
 this height.'), ('iterations', 'The number of times to execute the spring
 layout algorithm.'), ('layout', 'A layout algorithm -- one of : "acyclic",
 "circular" (plots the graph with vertices evenly distributed on a circle),
 "ranked", "graphviz", "planar", "spring"
 (traditional spring layout, using the graph\'s current positions as
 initial positions), or "tree" (the tree will be plotted in levels,
 depending on minimum distance for the root).'), ('prog', 'Which graphviz
 layout program to use -- one of
 "circo", "dot", "fdp", "neato", or "twopi".'), ('save_pos', 'Whether or
 not to save the computed position for the graph.'), ('spring', 'Use spring
 layout to finalize the current layout.'), ('tree_orientation', 'The
 direction of tree branches -- "up" or "down".'), ('tree_root', 'A vertex
 designation for drawing trees. a vertex of the tree to be used as the root
 for the ``layout="tree"`` option. If
 no root is specified, then one is chosen at random. Ignored unless
 ``layout=\'tree\'``')]
 }}}
 2. I think the following should mention something like "{{{You may want to
 give it as an argument to graphplot() instead}}}" (i.e. the `GraphPlot`
 should be all lower case)
 {{{
 865                 deprecation(13891, "This method takes no argument !
 You may want "
 866                                    "to give it to GraphPlot instead.")
 }}}

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