如果您从 R 中使用 igraph,请使用此选项
layout_with_kk {igraph} | R 文档 |
基于弹簧的物理模型,将顶点放置在平面或 3D 空间中。
layout_with_kk(
graph,
coords = NULL,
dim = 2,
maxiter = 50 * vcount(graph),
epsilon = 0,
kkconst = max(vcount(graph), 1),
weights = NULL,
minx = NULL,
maxx = NULL,
miny = NULL,
maxy = NULL,
minz = NULL,
maxz = NULL,
niter,
sigma,
initemp,
coolexp,
start
)
with_kk(...)
图 |
输入图。边方向将被忽略。 |
coords |
如果不是 |
dim |
整数标量,2 或 3,布局的维度。二维布局放置在平面上,三维布局放置在 3d 空间中。 |
maxiter |
要执行的最大迭代次数。算法可能会提前终止,请参阅 |
epsilon |
数值标量,如果最大增量小于此值,则算法终止。(有关增量的含义,请参阅下面的参考资料。)如果将其设置为零,则函数始终执行 |
kkconst |
数值标量,Kamada-Kawai 顶点吸引常数。典型(且默认)值为顶点数。 |
weights |
边权重,较大的值将导致较长的边。请注意,这与 |
minx |
如果不是 |
maxx |
类似于 |
miny |
类似于 |
maxy |
类似于 |
minz |
类似于 |
maxz |
类似于 |
niter, sigma, initemp, coolexp |
从 igraph 版本 0.8.0 开始不支持这些参数,并且会被忽略(并发出警告)。 |
开始 |
|
... |
传递给 |
有关该算法的详细信息,请参阅下面引用的论文。
此函数在 igraph 版本 0.8.0 中从头开始重写,现在忠实地遵循了 Kamada 和 Kawai 的原始出版物。
一个数值矩阵,具有两列 (dim=2) 或三列 (dim=3),以及与顶点数一样多的行,顶点的 x、y 和可能的 z 坐标。
Gabor Csardi csardi.gabor@gmail.com
Kamada, T. and Kawai, S.: An Algorithm for Drawing General Undirected Graphs. Information Processing Letters, 31/1, 7–15, 1989.
layout_with_drl
, plot.igraph
, tkplot
其他图形布局:add_layout_()
, component_wise()
, layout_as_bipartite()
, layout_as_star()
, layout_as_tree()
, layout_in_circle()
, layout_nicely()
, layout_on_grid()
, layout_on_sphere()
, layout_randomly()
, layout_with_dh()
, layout_with_fr()
, layout_with_gem()
, layout_with_graphopt()
, layout_with_lgl()
, layout_with_mds()
, layout_with_sugiyama()
, layout_()
, merge_coords()
, norm_coords()
, normalize()
g <- make_ring(10)
E(g)$weight <- rep(1:2, length.out=ecount(g))
plot(g, layout=layout_with_kk, edge.label=E(g)$weight)