如何旋转igraph网络图? [英] How to rotate igraph network plot?
问题描述
我正在尝试旋转基于R包的igraph网络图.在igraph指南中,没有足够的解释如何使用R代码
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)
推荐答案
根据文档,对于R包 igraph
:
tk_rotate旋转图形,其参数可以以度或弧度给出.
the tk_rotate rotates the figure, its parameter can be given either in degrees or in radians.
特别值得注意的是参数 tkp.id
.确保将tkplot窗口分配给该值,以便可以在函数中将其作为 tkp.id
引用.
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
要关闭/重塑等的tkplot窗口的ID.
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)
由 reprex程序包(v0.2.0)创建于2018-09-03.
Created on 2018-09-03 by the reprex package (v0.2.0).
这篇关于如何旋转igraph网络图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!