简体   繁体   中英

How to rotate igraph network plot?

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) 

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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