Vertex shapes             package:igraph             R Documentation

_V_a_r_i_o_u_s _v_e_r_t_e_x _s_h_a_p_e_s _w_h_e_n _p_l_o_t_t_i_n_g _i_g_r_a_p_h _g_r_a_p_h_s

_D_e_s_c_r_i_p_t_i_o_n:

     Starting from version 0.5.1 igraph supports different vertex
     shapes when plotting graphs.

_D_e_t_a_i_l_s:

     Note that the current vertex shape implementation is experimental
     and it might change in the future. Currently vertex shapes are
     implemented only for 'plot.igraph'.

     In igraph a vertex shape is defined by a function that 1) provides
     information about the size of the shape for clipping the edges and
     2) plots the shape if requested. These functions are called "shape
     functions" in the rest of this manual page.

     Shape functions have a ''mode'' argument that decides in which
     mode they should operate. ''clip'' selects clipping mode and
     ''plot'' selects plotting mode.

     In clipping mode a shape function has the following arguments:

   _c_o_o_r_d_s A matrix with four columns, it contains the coordinates of
        the vertices for the edge list supplied in the 'el' argument.

   _e_l A matrix with two columns, the edges of which some end points
        will be clipped. It should have the same number of rows as
        'coords'.

   _m_o_d_e "'clip'" for choosing clipping mode.

   _p_a_r_a_m_s This is a function object that can be called to query
        vertex/edge/plot graphical parameters. The first argument of
        the function is "'vertex'", "'edge'" or "'plot'" to decide the
        type of the parameter, the second is a character string giving
        the name of the parameter. E.g.


                params("vertex", "size")


   _e_n_d Character string, it gives which end points will be used.
        Possible values are "'both'", "'from'" and "'to'". If "'from'"
        the function is expected to clip the first column in the 'el'
        edge list, "'to'" selects the second column, "'both'" selects
        both.

     In 'clipping' mode, a shape function should return a matrix with
     the same number of rows as the 'el' arguments. If 'end' is 'both'
     then the matrix must have four columns, otherwise two. The matrix
     contains the modified coordinates, with the clipping applied.

     In plotting mode the following arguments are supplied to the shape
     function:

   _c_o_o_r_d_s The coordinates of the vertices, a matrix with two columns.

   _v The ids of the vertices to plot. It should match the number of
        rows in the 'coords' argument.

   _m_o_d_e "'plot'" for choosing plotting mode.

   _p_a_r_a_m_s The same as in clipping mode, see above.

     In 'plotting' mode the return value of the shape function is not
     used.

_A_u_t_h_o_r(_s):

     Gabor Csardi csardi@rmki.kfki.hu

_S_e_e _A_l_s_o:

     'igraph.plotting', 'plot.igraph'

_E_x_a_m_p_l_e_s:

     ## Not run: 
     g <- graph.ring(10, dir=TRUE, mut=TRUE)
     plot(g, vertex.shape="rectangle", layout=layout.circle)
     ## End(Not run)

