#Plot a small adjacency matrix
plot.sociomatrix(rgraph(5))
#Plot a much larger one
plot.sociomatrix(rgraph(100), drawlab=FALSE, diaglab=FALSE)
#Example involving a signed, valued graph and custom colors
mycolfun <- function(z){ #Custom color function
ifelse(z<0, rgb(1,0,0,alpha=1-1/(1-z)), ifelse(z>0,
rgb(0,0,1,alpha=1-1/(1+z)), rgb(0,0,0,alpha=0)))
}
sg <- rgraph(25) * matrix(rnorm(25^2),25,25)
plot.sociomatrix(sg, scale.values=FALSE, cell.col=mycolfun) #Blue pos/red neg
Run the code above in your browser using DataLab