Learn R Programming

sna (version 2.3-2)

plot.sociomatrix: Plot Matrices Using a Color/Intensity Grid

Description

Plots a matrix, m, associating the magnitude of the i,jth cell of m with the color of the i,jth cell of an nrow(m) by ncol(m) grid.

Usage

"plot"(x, labels=NULL, drawlab=TRUE, diaglab=TRUE, drawlines=TRUE, xlab=NULL, ylab=NULL, cex.lab=1, ...)
sociomatrixplot(x, labels=NULL, drawlab=TRUE, diaglab=TRUE, drawlines=TRUE, xlab=NULL, ylab=NULL, cex.lab=1, ...)

Arguments

x
an input graph.
labels
a list containing the vectors of row and column labels (respectively); defaults to numerical labels.
drawlab
logical; add row/column labels to the plot?
diaglab
logical; label the diagonal?
drawlines
logical; draw lines to mark cell boundaries?
xlab
x axis label.
ylab
y axis label.
cex.lab
optional expansion factor for labels.
...
additional arguments to plot.

Value

None

Details

plot.sociomatrix is particularly valuable for examining large adjacency matrices, whose structure can be non-obvious otherwise. sociomatrixplot is an alias to plot.sociomatrix, and may eventually supersede it.

See Also

plot.blockmodel

Examples

Run this code
#Plot a small adjacency matrix
plot.sociomatrix(rgraph(5))

#Plot a much larger one
plot.sociomatrix(rgraph(100),drawlab=FALSE,diaglab=FALSE)

Run the code above in your browser using DataLab