Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
# 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