2
votes

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
Thanks for your question. To get the best answer possible I would recommend trying to present a reproducible example see here. That way others can see what you have tried, copy and paste your code and recommend a solution. Also check out the example code at the bottom of R help documents as these can help demo the functions you are interested in.Dean
I have supplied an answer to you question in the meantime, if this does not help, please try and be more specific per above comment.Dean

1 Answers

1
votes

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