Learn R Programming

network (version 1.20.0)

plot.network.default: Two-Dimensional Visualization for Network Objects

Description

plot.network produces a simple two-dimensional plot of network x, using optional attribute attrname to set edge values. A variety of options are available to control vertex placement, display details, color, etc.

Usage

# S3 method for network
plot(x, ...)

# S3 method for default plot.network(x, attrname = NULL, label = network.vertex.names(x), coord = NULL, jitter = TRUE, thresh = 0, usearrows = TRUE, mode = "fruchtermanreingold", displayisolates = TRUE, interactive = FALSE, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, pad = 0.2, label.pad = 0.5, displaylabels = !missing(label), boxed.labels = FALSE, label.pos = 0, label.bg = "white", vertex.sides = 50, vertex.rot = 0, vertex.lwd=1, arrowhead.cex = 1, label.cex = 1, loop.cex = 1, vertex.cex = 1, edge.col = 1, label.col = 1, vertex.col = 2, label.border = 1, vertex.border = 1, edge.lty = 1, label.lty = NULL, vertex.lty = 1, edge.lwd = 0, edge.label = NULL, edge.label.cex = 1, edge.label.col = 1, label.lwd = par("lwd"), edge.len = 0.5, edge.curve = 0.1, edge.steps = 50, loop.steps = 20, object.scale = 0.01, uselen = FALSE, usecurve = FALSE, suppress.axes = TRUE, vertices.last = TRUE, new = TRUE, layout.par = NULL, ...)

Arguments

Value

A two-column matrix containing the vertex positions as x,y coordinates

Details

plot.network is the standard visualization tool for the network class. By means of clever selection of display parameters, a fair amount of display flexibility can be obtained. Vertex layout -- if not specified directly using coord -- is determined via one of the various available algorithms. These should be specified via the mode argument; see network.layout for a full list. User-supplied layout functions are also possible -- see the aforementioned man page for details.

Note that where is.hyper(x)==TRUE, the network is converted to bipartite adjacency form prior to computing coordinates. If interactive==TRUE, then the user may modify the initial network layout by selecting an individual vertex and then clicking on the location to which this vertex is to be moved; this process may be repeated until the layout is satisfactory.

References

Butts, C. T. (2008). “network: a Package for Managing Relational Data in R.” Journal of Statistical Software, 24(2). tools:::Rd_expr_doi("10.18637/jss.v024.i02")

Wasserman, S., and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.

See Also

network, network.arrow, network.loop, network.vertex

Examples

Run this code

#Construct a sparse graph
m<-matrix(rbinom(100,1,1.5/9),10)
diag(m)<-0
g<-network(m)

#Plot the graph
plot(g)

#Load Padgett's marriage data
data(flo)
nflo<-network(flo)
#Display the network, indicating degree and flagging the Medicis
plot(nflo, vertex.cex=apply(flo,2,sum)+1, usearrows=FALSE,
    vertex.sides=3+apply(flo,2,sum),
    vertex.col=2+(network.vertex.names(nflo)=="Medici"))

Run the code above in your browser using DataLab