layout_as_spiral | R Documentation |
Layout a graph on a spiral
layout_as_spiral(
g,
type = c("Archimedean", "Bernoulli", "Fermat", "Euler"),
arcs = 6,
a = 1,
b = NULL,
rev = FALSE
)
g |
An igraph object. If ( |
type |
Spiral type, one of |
arcs |
The number of arcs (half circles/ovals) that make up the spiral (default = |
a |
Parameter controlling the distance between spiral arms, however, the effect will vary for different spiral types (default = |
b |
Parameter controlling where the spiral originates. A value of 1 will generally place the origin in the center. The default |
rev |
If |
An igraph layout
library(igraph)
g <- igraph::sample_gnp(100, 1/100)
# Equiangular spiral: Any line from the origin cuts at the same angle.
plot(g, layout = layout_as_spiral(g, type = "Bernoulli", arcs = 5))
# The arms of Fermat's spiral diverge quadratically.
plot(g, layout = layout_as_spiral(g, type = "Fermat", arcs = 5))
# Equidistance of intersection points along a line through the origin.
plot(g, layout = layout_as_spiral(g, type = "Archimedean", arcs = 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.