View source: R/plot_multilayer_alluvial.R
plot_multilayer_alluvial | R Documentation |
Alluvial plot for multilayer network
plot_multilayer_alluvial(x, module_labels = F)
x |
An object of class |
module_labels |
Should module labels be presented |
Use ggplot and ggalluvial to plot an alluvial plot that shows the flow of nodes between modules. Very useful for temporal networks. Because the output is a ggplot object it can be further manipulated with standard ggplot2.
An object of class ggplot
.
ggplot2, ggalluvial, infomap_monolayer
## Not run:
emln <- create_multilayer_object(extended = siberia1982_7_links,
nodes = siberia1982_7_nodes, intra_output_extended = TRUE, inter_output_extended = TRUE)
emln_modules <- run_infomap_multilayer(M=emln, relax = FALSE,
flow_model = 'directed', silent = TRUE, trials = 100, seed = 497294,
temporal_network = TRUE)
# Plot alluvial diagram
plot_multilayer_alluvial(emln_modules, module_labels = FALSE)
# Can also modify the plot
plot_multilayer_alluvial(emln_modules, module_labels = FALSE)+
geom_stratum(linetype='dashed', color='gray')+
scale_x_continuous(breaks=seq(0,6,1))+
scale_y_continuous(breaks=seq(0,70,5))+
labs(y='Number of species')+
theme_bw()+
theme(legend.position = "none",
panel.grid = element_blank(),
axis.text = element_text(color='black', size = 20),
axis.title = element_text(size=20))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.