简体   繁体   English

如何旋转 igraph 网络图?

[英]How to rotate igraph network plot?

I'm trying to rotate the R package based igraph network plot.我正在尝试旋转基于 R 包的 igraph 网络图。 In the igraph guidebook not enough explanation how to use R code在 igraph 指南中没有足够的解释如何使用 R 代码

tk_rotate(tkp.id, degree = NULL, rad = NULL) 

For the R package igraph according to the documentation:根据文档,对于 R 包igraph

the tk_rotate rotates the figure, its parameter can be given either in degrees or in radians. tk_rotate 旋转图形,它的参数可以以度数或弧度给出。

Of particular note is the argument tkp.id .特别值得注意的是参数tkp.id Make sure you assign the tkplot window to this value so you can reference it as the tkp.id in the function.确保将 tkplot 窗口分配给此值,以便您可以在函数tkp.id其作为tkp.id引用。

tkp.id The id of the tkplot window to close/reshape/etc. tkp.id要关闭/重塑/等的 tkplot 窗口的 ID。

Here is a reproducible example that demonstrates it's use:这是一个可重现的示例,演示了它的用法:

library(igraph)
#> 
#> Attaching package: 'igraph'
#> The following objects are masked from 'package:stats':
#> 
#>     decompose, spectrum
#> The following object is masked from 'package:base':
#> 
#>     union
g <- make_ring(10)
x <- tkplot(g)
tk_rotate(x, degree = NULL, rad = NULL)

Created on 2018-09-03 by the reprex package (v0.2.0).reprex 包(v0.2.0) 于 2018 年 9 月 3 日创建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM