How to rotate igraph network plot?

纵然是瞬间 提交于 2021-02-10 06:14:37

问题


I'm trying to rotate the R package based igraph network plot. In the igraph guidebook not enough explanation how to use R code

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

回答1:


For the R package igraph according to the documentation:

the tk_rotate rotates the figure, its parameter can be given either in degrees or in radians.

Of particular note is the argument tkp.id. Make sure you assign the tkplot window to this value so you can reference it as the tkp.id in the function.

tkp.id The id of the tkplot window to close/reshape/etc.

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).



来源:https://stackoverflow.com/questions/52143311/how-to-rotate-igraph-network-plot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!