Skip to contents

Command that operates like ggplot

Usage

ggnetplot(net, layout = NULL, ...)

Arguments

net

Network to plot

layout

Optional igraph-style plotting layout

...

Additional key-value aesthetics to pass to aes() in ggplot call

Value

ggplot()-like command for initiating ggplot2 network plots

Examples

library(ggnetwork)
#> Loading required package: ggplot2
socnet <- igraph::make_graph(~ 1-2:3:4,2:4)
igraph::V(socnet)$name <- c("Mateus", "Marcos", "Lucas", "João")
ggnetplot(socnet) + 
  geom_edges(linewidth=0.1) + 
  geom_nodes(color = "#008566", size=3) + 
  geom_nodelabel_repel(aes(label = name), size = 1.5) + 
  theme_blank()