Description Usage Arguments Value Author(s) References See Also Examples
Visualization of networks using hierarchical edge bundles referenced below. Plots a graph using a hierarchical tree as guides for the edges.
1 2 3 |
graph |
A |
phylo |
A |
beta |
A number between 0 and 1 controlling the bundling strength. |
include.mrca |
Should the only the most recent common ancestor be used in the shortest path used for the splines? |
simplify |
Simplify the paths by taking the convex hull of the control points. Can sometimes yield better results. |
... |
Arguments passed to |
args.lines |
A list of arguments passed to |
args.points |
A list of arguments passed to |
debug |
Plot some extra debug info. |
e.cols |
A character vector giving the colors of the edges.
Overrides any use of |
v.use.only |
An integer vector giving the nodes from which edges are
to be drawn. E.g. |
e.use.only |
An integer vector giving the edges to be drawn.
E.g. |
Plots to a new device.
Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>
Holten, Danny. "Hierarchical edge bundles: Visualization of adjacency relations in hierarchical data." Visualization and Computer Graphics, IEEE Transactions on 12.5 (2006): 741-748.
See plot.phylo
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | library("igraph")
library("ape")
n <- 10
# Create a graph
corr <- cor(matrix(rnorm(n^2), n, n))
rownames(corr) <- colnames(corr) <- LETTERS[1:n]
adj.mat <- abs(corr)
graph <- graph.adjacency(adj.mat, mode = "un", weighted = TRUE, diag = FALSE)
E(graph)$color <- ifelse(corr[lower.tri(corr)] < 0, "blue", "red")
E(graph)$width <- 10*adj.mat[lower.tri(adj.mat)]
# Generate dendrogram
phylo <- as.phylo(hclust(as.dist(1 - adj.mat), method = "complete"))
# Plot 1 - the graph and the tree
par(mfrow = c(1,2))
plot(graph, layout = layout.circle)
plot(phylo, type = "fan")
# Plot 2 - Combining the two
plotHEB(graph, phylo, type = "fan", e.cols = E(graph)$color)
par(mfrow = c(1, 2), mar = c(0, 0, 2, 0))
plotHEB(graph, phylo, type = "fan", beta = 0.95,
args.lines = list(col = "#4682B470"),
main = "High bundling strength")
plotHEB(graph, phylo, type = "fan", beta = 0.55,
args.lines = list(col = "#4682B470"),
main = "Low bundling strength")
# Plot 3 - Extra control of plotting and debugging
par(mfrow = c(1,2))
plot(phylo, type = "unrooted")
plotHEB(graph, phylo, type = "unrooted", beta = 0.8,
v.use.only = 1, debug = FALSE,
args.lines = list(col = "red", lwd = 2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.