Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

network.vertex

Add Vertices to a Plot


Description

network.vertex adds one or more vertices (drawn using polygon) to a plot.

Usage

network.vertex(x, y, radius = 1, sides = 4, border = 1, col = 2,
  lty = NULL, rot = 0, lwd = 1, ...)

Arguments

x

a vector of x coordinates.

y

a vector of y coordinates.

radius

a vector of vertex radii.

sides

a vector containing the number of sides to draw for each vertex.

border

a vector of vertex border colors.

col

a vector of vertex interior colors.

lty

a vector of vertex border line types.

rot

a vector of vertex rotation angles (in degrees).

lwd

a vector of vertex border line widths.

...

Additional arguments to polygon

Details

network.vertex draws regular polygons of specified radius and number of sides, at the given coordinates. This is useful for routines such as plot.network, which use such shapes to depict vertices.

Value

None

Note

network.vertex is a direct adaptation of gplot.vertex from the sna package.

Author(s)

Carter T. Butts buttsc@uci.edu

References

Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). https://www.jstatsoft.org/v24/i02/

See Also

Examples

#Open a plot window, and place some vertices
plot(0,0,type="n",xlim=c(-1.5,1.5),ylim=c(-1.5,1.5),asp=1)
network.vertex(cos((1:10)/10*2*pi),sin((1:10)/10*2*pi),col=1:10,
    sides=3:12,radius=0.1)

network

Classes for Relational Data

v1.16.1
GPL (>= 2)
Authors
Carter T. Butts [aut, cre], David Hunter [ctb], Mark Handcock [ctb], Skye Bender-deMoll [ctb], Jeffrey Horner [ctb], Li Wang [ctb]
Initial release
2020-10-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.