plot.network.ergm
produces a simple two-dimensional plot of
the network object x
. A variety of options are available
to control vertex placement, display details, color, etc.
The function is based on the
plotting capabilities of the network
package with additional
pre-processing of arguments.
Some of the capabilites require the latentnet
package.
See plot.network
in the network
package for details.## S3 method for class 'ergm':
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=FALSE,
boxed.labels=TRUE,
label.pos=0,
label.bg="white",
vertex.sides=8,
vertex.rot=0,
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,
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,
cex.main=par("cex.main"),
cex.sub=par("cex.sub"),
seed=NULL,
latent.control=list(maxit=500,
trace=0,
dyadsample=10000,
penalty.sigma=c(5,0.5),
nsubsample=200),
colornames="rainbow",
verbose=FALSE,
latent=FALSE,
...)
network
.network.vertex.names
.mode
setting.thresh
are displayed. By default, thresh
=0.network.layout
function.
These include
"latent"
, "latentPrior"
,
and
"fruchtermanreingold"
.boxed.labels==TRUE
), in character size units.0
results in labels which are placed away from the center of the plotting region; 1
, 2
, 3
, and 4
result in labels being placboxed.labels==TRUE
); may be a vector, if boxes are to be of different colors.boxed.labels==TRUE
); may be given as a vector, if label boxes are to have different colors.boxed.labels==TRUE
); may be given as a vector, if label boxes are to have different line types.edge.lwd*dat
. May be given as a vector, adjacency matrix, or edge attribute name, if edges are to have different line widths.boxed.labels==TRUE
); may be given as a vector, if label boxes are to have different line widths.uselen==TRUE
, curved edge lengths are scaled by edge.len
.usecurve==TRUE
, the extent of edge curvature is controlled by edge.curv
. May be given as a fixed value, vector, adjacency matrix, or edge attribute name, if edges are to have different levels of curvature.edge.len
to rescale edge lengths?edge.curve
?new==FALSE
, vertices and edges will be added to the existing plot.network.layout
function specified in mode
.set.seed
.latent
and latentPrior
models, dyadsample
determines the size above which to sample the latent dyads; see ergm
and
colors()
.TRUE
, we will print out more information as we run the function.ergmm()
in latentnet
.plot
.mva
plot.network
is a version of the standard network visualization tool
within the sna
package. By means of clever selection
of display parameters, a fair amount of display flexibility
can be obtained. Network layout -- if not specified directly
using coord
-- is determined via one of the various
available algorithms. These are (briefly) as follows:
latentPrior
: Use a two-dimensional latent space model based on a
Bayesian minimum Kullback-Leibler fit.
See documentation forlatent()
inergm
.random
: Vertices are placed (uniformly) randomly within a square region about the origin.circle
: Vertices are placed evenly about the unit circle.circrand
: Vertices are placed in a ``Gaussian donut,'' with distance from the origin following a normal distribution and angle relative to the X axis chosen (uniformly) randomly.eigen
,princoord
: Vertices are placed via (the real components of) the first two eigenvectors of:eigen
: the matrix of correlations among (concatenated) rows/columns of the adjacency matrixprincoord
: the raw adjacency matrix.mds
,rmds
,geodist
,adj
,seham
: Vertices are placed by a metric MDS. The distance matrix used is given by:mds
: absolute row/column differences within the adjacency matrixrmds
: Euclidean distances between rows of the adjacency matrixgeodist
: geodesic distances between vertices within the networkadj
:$(\max A)-A$, where$A$is the raw adjacency matrixseham
: structural (dis)equivalence distances
(i.e., as persedist
in the packagesna
)
based on the Hamming metricspring
,springrepulse
: Vertices are placed
using a simple spring embedder. Parameters for the embedding
model are given byembedder.params
, in the following
order: vertex mass; equilibrium extension; spring coefficient;
repulsion equilibrium distance; and base coefficient of
friction. Initial vertex positions are in random order around
a circle, and simulation proceeds -- increasing the coefficient
of friction by the specified base value per unit time -- until
``motion'' within the system ceases. Ifspringrepulse
is specified, then an inverse-cube repulsion force between
vertices is also simulated; this force is calibrated so as to
be exactly equal to the force of a unit spring extension at
a distance specified by the repulsion equilibrium distance.plot
data(florentine)
plot(flomarriage) #Plot the Florentine Marriage data
plot(network(10)) #Plot a random network
plot(flomarriage,interactive="points")
Run the code above in your browser using DataLab