plot-methods            package:Rgraphviz            R Documentation

_P_l_o_t _a _g_r_a_p_h _o_b_j_e_c_t - _m_e_t_h_o_d_s

_D_e_s_c_r_i_p_t_i_o_n:

     A plot method for 'graph' objects.

_U_s_a_g_e:

     ''graph': plot(x, y, ..., subGList=list(), attrs=list(),
     nodeAttrs=list(), edgeAttrs=list(), xlab="", ylab="", main=NULL,
     sub=sub, recipEdges=c("combined", "distinct"))'

     ''Ragraph': plot(x, y, ..., xlab="", ylab="", main=NULL, sub=sub,
     drawNode=drawAgNode, nodeAttrs=list(), edgeAttrs=list())'

_a_r_g_u_m_e_n_t_s:


     _x The 'graph' object to plot

     _y The layout method to use: One of 'dot', 'neato', 'twopi',
          'circo', and 'fdp'.  The default is 'dot' 

     _s_u_b_G_L_i_s_t A list of subgraphs taken from the primary 'graph' object
          to be plotted.  If provided, these subgraphs will be
          clustered visually.  If not provided, no clusters will be
          used.

     _a_t_t_r_s A list of Graphviz attributes to be sent to the layout
          engine

     _n_o_d_e_A_t_t_r_s A list of attributes for specific nodes

     _e_d_g_e_A_t_t_r_s A list of attributes for specific edges

     _x_l_a_b Label for the x axis of the plot

     _y_l_a_b Label for the y axis of the plot

     _m_a_i_n Main label for the plot

     _s_u_b Subtitle for the plot

     _d_r_a_w_N_o_d_e Function to draw the nodes.  The default is 'drawAgNode'

     _r_e_c_i_p_E_d_g_e_s Determines how to draw reciprocating edges.  See
          'agopen' 

     ... General commands to be sent to plot

_d_e_t_a_i_l_s:

     The first plot method in the 'usage' section corresponds to the
     'graph' class in the 'graph' package.  It will convert the 'graph'
     object into an object of class 'Ragraph' by using Graphviz to
     perform the layout.  Then it will call the plot method for
     'Ragraph'.  The 'plot.graph' method is nothing more then a wrapper
     that calls 'agopen' and 'plot.Ragraph'.

     The second plot method in the 'usage' section is for the 'Ragraph'
     class, which describes a Graphviz structure of a graph.  This
     method will extract necessary information from the object and use
     it to plot the graph.

     Users can specify arbitrary drawing functions for the nodes of the
     'Ragraph' with the 'drawNode' argument, although caution is urged.
      The default drawing function for  all nodes is 'drawAgNode',
     which will draw a basic circle, ellipse or rectangle according to
     the layout specifications for each node. If supplying a custom
     function, users are encouraged to look at the code of this
     function for a more clear picture of the information required to
     properly draw a node.   Users can specify either one custom
     function to be used for all nodes or a list (where length is equal
     to the nubmer of nodes) of functions where the Nth element in the
     list provides the drawing function for the Nth node, and every
     function will take four parameters - the first is an object of
     class 'AgNode' representing the node itself and the second is an
     object of class 'xyPoint' representing the upper right corner of
     the Graphviz plotting region (where the lower left is '0,0'). The
     third parameter, 'attrs' is a node attribute list and represents
     post-layout attribute changes where the user wants to override
     values present in the layout.  The last argument, 'radConv' is a
     divisor to the radius and is used to convert from 'Graphviz' units
     to R plotting units.  Outside of the first argument, the rest of
     these (particularly 'radConv' which generally shouldn't be
     specifically set) do not need to be set by the user, but any
     drawing function must have them as parameters.

     The 'attrs' list requires a particular format.  It must be of
     length 3 with names 'graph', 'node', and 'edge'.  Each of these
     elements themselves are lists - such that an element of 'graph'
     corresponds to a graph element.  A full listing of attributes and
     their possible settings is available at
     'http://www.research.att.com/~erg/graphviz/info/attrs.html'.  All
     attribute values should be entered as character strings (even if
     the requested value is to be otherwise).

     The 'nodeAttrs' list is used to specify attributes on a particular
     node, instead of for all nodes.  The format of this list is such
     that the elements correspond to attributes (the name of the
     element is used to note which attribute) and each element contains
     a named vector.  The names of the vector denote which nodes are
     having this attribute set and the values in the vector specify the
     value.

     The 'edgeAttrs' list is identical in format to 'nodeAttrs'.
     However, the name of the edges is in a particular format where an
     edge between x and y is named 'x~y'.  Note that even in an
     undirected graph that 'x~y' is not the same as 'y~x' - the name
     must be in the same order that the edge was defined as having.

_v_a_l_u_e:

     The 'Ragraph' object used for plotting

_a_u_t_h_o_r:

     Jeff Gentry

_s_e_e_a_l_s_o:

     'graphNEL-class', 'graph-class'

_E_x_a_m_p_l_e_s:

     #  WHY DOES THIS NOT WORK IN CHECK?
     #  V <- letters[1:10]
     #  M <- 1:4
     #  g1 <- randomGraph(V, M, .2)
     #  plot(g1)

