Last active
May 18, 2016 00:00
-
-
Save goldingn/76ff865c9ca62b082576cc9b9aab658d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# devtools::install_github("briatte/ggnet") | |
library(network) | |
library(sna) | |
library(ggplot2) | |
library(viridis) | |
library(ggnet) | |
# random graph | |
set.seed(1) | |
n <- 500 | |
net = rgraph(n, mode = "graph", tprob = 2/n) | |
net = network(net, directed = FALSE) | |
# set colours | |
bg <- viridis(100)[1] | |
cols <- viridis(2 * n) [(n + 1):(2 * n)] | |
net %v% "colour" = sample(cols, n) | |
png('QSIG_network_logo.png', | |
width = 3000, | |
height = 3000, | |
pointsize = 90) | |
ggnet2(net, | |
size = 12, | |
color = cols, | |
edge.color = grey(0.8)) + | |
theme(panel.background = element_rect(fill = bg)) | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment