【问题标题】:igraph: plot only edges, no verticesigraph:仅绘制边,不绘制顶点
【发布时间】:2020-07-15 19:05:34
【问题描述】:

我想绘制一个没有顶点的igraph 对象。简单地指定vertex.color = "white" 并没有多大帮助,因为顶点重叠的顶点数量非常多。 vertex.size = 0 绘制小顶点,请参见左侧的图 1。我试过vertex.size = (-1) 会产生错误:

Error in symbols(x = coords[, 1], y = coords[, 2], bg = vertex.color,  : 
  invalid symbol parameter

即使它在右侧的以下绘图 2 中没有绘制顶点(或者它们太小以至于不可见?):

情节 1 和 2

数据和代码:

g <- make_ring(10) 
plot(g,vertex.size = 0) # plot 1
plot(g,vertex.size = (-1)) # plot 2

【问题讨论】:

    标签: r networking igraph


    【解决方案1】:

    我认为使用多个顶点选项可以实现您想要的:

    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) 
    
    plot(g,
         vertex.shape = 'none',
         vertex.size = 0,
         vertex.label= NA)
    

    reprex package (v0.3.0) 于 2020 年 4 月 3 日创建

    其他选项见help("igraph.plotting")

    【讨论】:

      猜你喜欢
      • 2012-10-19
      • 1970-01-01
      • 1970-01-01
      • 2016-01-05
      • 1970-01-01
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多