Ticket #13891: trac_13891-docagain.patch

File trac_13891-docagain.patch, 5.3 KB (added by ncohen, 6 years ago)
  • sage/graphs/generic_graph.py

    # HG changeset patch
    # User Nathann Cohen <nathann.cohen@gmail.com>
    # Date 1359570405 -3600
    # Node ID 6254cd0f49d862ce94bb138b7e2ff81992bc4954
    # Parent  f73d057f787074df08523a03792bc968de615794
    Default parameters for Graph.plot() and Graph.show() -- Doc. Again.
    
    diff --git a/sage/graphs/generic_graph.py b/sage/graphs/generic_graph.py
    a b  
    1443014430             7: [1.46..., -0.473...],
    1443114431             8: [0.902..., 0.773...],
    1443214432             9: [2.48..., -0.119...]}
    14433        
    14434         ::
    14435        
     14433
     14434        ::
     14435
    1443614436            sage: T = list(graphs.trees(7))
    1443714437            sage: t = T[3]
    1443814438            sage: t.plot(heights={0:[0], 1:[4,5,1], 2:[2], 3:[3,6]})
    14439        
    14440         ::
    14441        
     14439
     14440        ::
     14441
    1444214442            sage: T = list(graphs.trees(7))
    1444314443            sage: t = T[3]
    1444414444            sage: t.plot(heights={0:[0], 1:[4,5,1], 2:[2], 3:[3,6]})
     
    1445014450            sage: t.set_edge_label(2,6,3/2)
    1445114451            sage: t.set_edge_label(0,4,66)
    1445214452            sage: t.plot(heights={0:[0], 1:[4,5,1], 2:[2], 3:[3,6]}, edge_labels=True)
    14453        
    14454         ::
    14455        
     14453
     14454        ::
     14455
    1445614456            sage: T = list(graphs.trees(7))
    1445714457            sage: t = T[3]
    1445814458            sage: t.plot(layout='tree')
    14459        
    14460         ::
    14461        
     14459
     14460        ::
     14461
    1446214462            sage: t = DiGraph('JCC???@A??GO??CO??GO??')
    1446314463            sage: t.plot(layout='tree', tree_root=0, tree_orientation="up")
    1446414464            sage: D = DiGraph({0:[1,2,3], 2:[1,4], 3:[0]})
    1446514465            sage: D.plot()
    14466            
     14466
    1446714467            sage: D = DiGraph(multiedges=True,sparse=True)
    1446814468            sage: for i in range(5):
    1446914469            ...     D.add_edge((i,i+1,'a'))
    1447014470            ...     D.add_edge((i,i-1,'b'))
    1447114471            sage: D.plot(edge_labels=True,edge_colors=D._color_by_label())
    14472            
     14472
    1447314473            sage: g = Graph({}, loops=True, multiedges=True,sparse=True)
    1447414474            sage: g.add_edges([(0,0,'a'),(0,0,'b'),(0,1,'c'),(0,1,'d'),
    1447514475            ...     (0,1,'e'),(0,1,'f'),(0,1,'f'),(2,1,'g'),(2,2,'h')])
     
    1448314483            sage: P = D.plot()
    1448414484
    1448514485        ::
    14486        
     14486
    1448714487            sage: G=Graph({'a':['a','b','b','b','e'],'b':['c','d','e'],'c':['c','d','d','d'],'d':['e']},sparse=True)
    1448814488            sage: G.show(pos={'a':[0,1],'b':[1,1],'c':[2,0],'d':[1,0],'e':[0,0]})
    1448914489        """
     
    1449314493        """
    1449414494        Shows the (di)graph.
    1449514495
    14496         For syntax and lengthy documentation, see G.plot?. Any options not
    14497         used by plot will be passed on to the Graphics.show method.
     14496        For syntax and lengthy documentation, see method
     14497        :meth:`GenericGraph.plot`. Any options not used by plot will be passed
     14498        on to the Graphics.show method.
    1449814499
    1449914500        .. NOTE::
    1450014501
     
    1452614527
    1452714528        See also the :mod:`sage.graphs.graph_latex` module for ways to use LaTeX
    1452814529        to produce an image of a graph.
    14529        
    14530         INPUT:
    14531        
    14532        
     14530
     14531        INPUT:
     14532
    1453314533        -  ``bgcolor`` - rgb tuple (default: (1,1,1))
    14534        
     14534
    1453514535        -  ``vertex_size`` - float (default: 0.06)
    14536        
     14536
    1453714537        -  ``vertex_colors`` - optional dictionary to specify
    1453814538           vertex colors: each key is a color recognizable by tachyon (rgb
    1453914539           tuple (default: (1,0,0))), and each corresponding entry is a list
    1454014540           of vertices. If a vertex is not listed, it looks invisible on the
    1454114541           resulting plot (it doesn't get drawn).
    14542        
     14542
    1454314543        -  ``edge_colors`` - a dictionary specifying edge
    1454414544           colors: each key is a color recognized by tachyon ( default:
    1454514545           (0,0,0) ), and each entry is a list of edges.
  • sage/graphs/graph_plot.py

    diff --git a/sage/graphs/graph_plot.py b/sage/graphs/graph_plot.py
    a b  
    2626
    2727**Plot options**
    2828
    29 Here is the list of options accepted by :meth:`GenericGraph.plot` and the
    30 constructor of :class:`GraphPlot`.
     29Here is the list of options accepted by :meth:`GenericGraph.plot
     30<sage.graphs.generic_graph.GenericGraph.plot>` and the constructor of
     31:class:`GraphPlot`.
    3132
    3233.. csv-table::
    3334    :class: contentstable
     
    101102
    102103.. NOTE::
    103104
    104    In order to define a default value permanently, you can add a couple of lines to
    105    :doc:`Sage's startup scripts <../../startup>`. Example ::
     105    * While ``DEFAULT_PLOT_OPTIONS`` affects both ``G.show()`` and ``G.plot()``,
     106      settings from ``DEFAULT_SHOW_OPTIONS`` only affects ``G.show()``.
     107
     108    * In order to define a default value permanently, you can add a couple of
     109      lines to :doc:`Sage's startup scripts <../../startup>`. Example ::
    106110
    107111       sage: import sage.graphs.graph_plot
    108112       sage: sage.graphs.graph_plot.DEFAULT_SHOW_OPTIONS['figsize'] = [4,4]
     
    684688        """
    685689        Shows the (Di)Graph associated with this ``GraphPlot`` object.
    686690
    687         For syntax and lengthy documentation, see :meth:`GraphPlot.plot`.
     691        INPUT:
     692
     693        This method accepts all parameters of
     694        :meth:`sage.plot.graphics.Graphics.show`.
    688695
    689696        .. NOTE::
    690697
     
    711718        """
    712719        Returns a graphics object representing the (di)graph.
    713720
     721        INPUT:
     722
     723        The options accepted by this method are to be found in the documentation
     724        of module :mod:`sage.graphs.graph_plot`.
     725
    714726        .. NOTE::
    715727
    716728            See :mod:`the module's documentation <sage.graphs.graph_plot>` for