如果您从 R 中使用 igraph,请使用此选项
| layout_in_circle {igraph} | R 文档 |
按照顶点 ID 的顺序将顶点放置在圆上。
layout_in_circle(graph, order = V(graph))
in_circle(...)
图 |
输入图。 |
order |
要放置在圆上的顶点,按其所需放置顺序排列。此处未包含的顶点将放置在 (0,0)。 |
... |
传递给 |
如果想以不同的顺序排列顶点,请使用 permute 函数对它们进行置换。
一个数值矩阵,有两列,每个顶点一行。
Gabor Csardi csardi.gabor@gmail.com
其他图布局:add_layout_(), component_wise(), layout_as_bipartite(), layout_as_star(), layout_as_tree(), layout_nicely(), layout_on_grid(), layout_on_sphere(), layout_randomly(), layout_with_dh(), layout_with_fr(), layout_with_gem(), layout_with_graphopt(), layout_with_kk(), layout_with_lgl(), layout_with_mds(), layout_with_sugiyama(), layout_(), merge_coords(), norm_coords(), normalize()
## Place vertices on a circle, order them according to their
## community
## Not run:
library(igraphdata)
data(karate)
karate_groups <- cluster_optimal(karate)
coords <- layout_in_circle(karate, order =
order(membership(karate_groups)))
V(karate)$label <- sub("Actor ", "", V(karate)$name)
V(karate)$label.color <- membership(karate_groups)
V(karate)$shape <- "none"
plot(karate, layout = coords)
## End(Not run)