Ticket #1394: plotdoc.patch

File plotdoc.patch, 7.6 KB (added by rlm, 14 years ago)
  • sage/graphs/graph.py

    # HG changeset patch
    # User R. L. Miller <rlmillster@gmail.com>
    # Date 1196747956 28800
    # Node ID 51cbf42f011e2d4ef19d5ca391e2a6163ac57d4b
    # Parent  475796f2172c243e3dbaa8b1dd5c9bf20c2404d9
    make docs more readable
    
    diff -r 475796f2172c -r 51cbf42f011e sage/graphs/graph.py
    a b class GenericGraph(SageObject): 
    25592559        return edge_colors     
    25602560
    25612561    def plot(self, pos=None, layout=None, vertex_labels=True,
    2562              edge_labels=False, vertex_size=200, graph_border=False,
    2563              vertex_colors=None, partition=None, edge_colors=None,
    2564              scaling_term=0.05, iterations=50,
    2565              color_by_label=False, heights=None):
     2562            edge_labels=False, vertex_size=200, graph_border=False,
     2563            vertex_colors=None, partition=None, edge_colors=None,
     2564            scaling_term=0.05, iterations=50,
     2565            color_by_label=False, heights=None):
    25662566        """
    25672567        Returns a graphics object representing the (di)graph.
    25682568       
    25692569        INPUT:
    25702570            pos -- an optional positioning dictionary
    25712571            layout -- what kind of layout to use, takes precedence over pos
    2572                 'circular' -- plots the graph with vertices evenly distributed on a circle
    2573                 'spring' -- uses the traditional spring layout, ignores the graphs current positions
     2572                'circular' -- plots the graph with vertices evenly distributed
     2573                    on a circle
     2574                'spring' -- uses the traditional spring layout, ignores the
     2575                    graphs current positions
    25742576            vertex_labels -- whether to print vertex labels
    2575             edge_labels -- whether to print edge labels. By default, False, but if True, the result
    2576                 of str(l) is printed on the edge for each label l. Labels equal to None are not printed.
     2577            edge_labels -- whether to print edge labels. By default, False, but
     2578                if True, the result of str(l) is printed on the edge for each
     2579                label l. Labels equal to None are not printed.
    25772580            vertex_size -- size of vertices displayed
    25782581            graph_border -- whether to include a box around the graph
    2579             vertex_colors -- optional dictionary to specify vertex colors: each key is a color recognizable
    2580                 by matplotlib, and each corresponding entry is a list of vertices. If a vertex is not listed,
    2581                 it looks invisible on the resulting plot (it doesn't get drawn).
    2582             edge_colors -- a dictionary specifying edge colors: each key is a color recognized by
    2583                 matplotlib, and each entry is a list of edges.
    2584             partition -- a partition of the vertex set. if specified, plot will show each cell in a different
    2585                 color. vertex_colors takes precedence.
    2586             scaling_term -- default is 0.05. if vertices are getting chopped off, increase; if graph
    2587                 is too small, decrease. should be positive, but values much bigger than
    2588                 1/8 won't be useful unless the vertices are huge
     2582            vertex_colors -- optional dictionary to specify vertex colors: each
     2583                key is a color recognizable by matplotlib, and each corresponding
     2584                entry is a list of vertices. If a vertex is not listed, it looks
     2585                invisible on the resulting plot (it doesn't get drawn).
     2586            edge_colors -- a dictionary specifying edge colors: each key is a
     2587                color recognized by matplotlib, and each entry is a list of edges.
     2588            partition -- a partition of the vertex set. if specified, plot will
     2589                show each cell in a different color. vertex_colors takes precedence.
     2590            scaling_term -- default is 0.05. if vertices are getting chopped off,
     2591                increase; if graph is too small, decrease. should be positive, but
     2592                values much bigger than 1/8 won't be useful unless the vertices
     2593                are huge
    25892594            iterations -- how many iterations of the spring layout algorithm to
    25902595                go through, if applicable
    25912596            color_by_label -- if True, color edges by their labels
    class GenericGraph(SageObject): 
    27142719        INPUT:
    27152720            pos -- an optional positioning dictionary
    27162721            layout -- what kind of layout to use, takes precedence over pos
    2717                 'circular' -- plots the graph with vertices evenly distributed on a circle
    2718                 'spring' -- uses the traditional spring layout, ignores the graphs current positions
     2722                'circular' -- plots the graph with vertices evenly distributed
     2723                    on a circle
     2724                'spring' -- uses the traditional spring layout, ignores the
     2725                    graphs current positions
    27192726            vertex_labels -- whether to print vertex labels
    2720             edge_labels -- whether to print edgeedge labels. By default, False, but if True, the result
    2721                 of str(l) is printed on the edge for each label l. Labels equal to None are not printed.
     2727            edge_labels -- whether to print edgeedge labels. By default, False,
     2728                but if True, the result of str(l) is printed on the edge for
     2729                each label l. Labels equal to None are not printed.
    27222730            vertex_size -- size of vertices displayed
    27232731            graph_border -- whether to include a box around the graph
    2724             vertex_colors -- optional dictionary to specify vertex colors: each key is a color recognizable
    2725                 by matplotlib, and each corresponding entry is a list of vertices. If a vertex is not listed,
    2726                 it looks invisible on the resulting plot (it doesn't get drawn).
    2727             edge_colors -- a dictionary specifying edge colors: each key is a color recognized by
    2728                 matplotlib, and each entry is a list of edges.
    2729             partition -- a partition of the vertex set. if specified, plot will show each cell in a different
    2730                 color. vertex_colors takes precedence.
    2731             scaling_term -- default is 0.05. if vertices are getting chopped off, increase; if graph
    2732                 is too small, decrease. should be positive, but values much bigger than
    2733                 1/8 won't be useful unless the vertices are huge
    2734             talk -- if true, prints large vertices with white backgrounds so that labels are legible on slies
     2732            vertex_colors -- optional dictionary to specify vertex colors: each
     2733                key is a color recognizable by matplotlib, and each corresponding
     2734                entry is a list of vertices. If a vertex is not listed, it looks
     2735                invisible on the resulting plot (it doesn't get drawn).
     2736            edge_colors -- a dictionary specifying edge colors: each key is a
     2737                color recognized by matplotlib, and each entry is a list of edges.
     2738            partition -- a partition of the vertex set. if specified, plot will
     2739                show each cell in a different color. vertex_colors takes precedence.
     2740            scaling_term -- default is 0.05. if vertices are getting chopped off,
     2741                increase; if graph is too small, decrease. should be positive, but
     2742                values much bigger than 1/8 won't be useful unless the vertices
     2743                are huge
     2744            talk -- if true, prints large vertices with white backgrounds so that
     2745                labels are legible on slies
    27352746            iterations -- how many iterations of the spring layout algorithm to
    27362747                go through, if applicable
    27372748            color_by_label -- if True, color edges by their labels