简体   繁体   中英

igraph: plot only edges, no vertices

I would like to plot an igraph object without vertices. Simply specifying vertex.color = "white" does not help much as the vertices overlap due to a very high number of vertices. vertex.size = 0 plots small vertices, See plot 1 on the left. I have tried vertex.size = (-1) which produces the error:

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

even though it plots no vertices (or they are so small to be invisible?) in the following Plot 2 on the right:

Plot 1 and 2

情节 1 情节 2

data and code:

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

I think what you want can be achieved using multiple vertex options:

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)

Created on 2020-04-03 by the reprex package (v0.3.0)

For other options see help("igraph.plotting")

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