igraph (version 0.5.3)

Vertex shapes: Various vertex shapes when plotting igraph graphs

Description

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

Arguments

concept

  • Vertex shapes
  • Visualization

sQuote

  • clipping
  • plotting

code

coords

itemize

  • coords

item

  • v
  • mode
  • params

dQuote

plot

Details

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:

  • coords
{A matrix with four columns, it contains the coordinates of the vertices for the edge list supplied in the el argument.} el{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.} mode{clip for choosing clipping mode.} params{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") } end{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.}

See Also

igraph.plotting, plot.igraph

Examples

Run this code
g <- graph.ring(10, dir=TRUE, mut=TRUE)
plot(g, vertex.shape="rectangle", layout=layout.circle)

Run the code above in your browser using DataCamp Workspace