1
有沒有一種方法可以繪製igraph中的網絡鏈接或節點的R與最小值和最大值成正比?R中圖表中的比例鏈接或節點大小?
使用繪圖鏈路和節點屬性是IGRAPH非常方便,但在一些網絡中的最小值和最大值之間的差異在網絡四通八達發現一個非常醜陋的圖畫。舉例來說,看到這樣的代碼:
#Transforming a sample network (Safariland) from the package bipartite into an igraph object
mat = Safariland
mat2 = cbind.data.frame(reference=row.names(mat),mat)
list = melt(mat2, na.rm = T)
colnames(list) = c("plant","animal","weight")
list[,1] = as.character(paste(list[,1]))
list[,2] = as.character(paste(list[,2]))
list2 = subset(list, weight > 0)
g = graph.data.frame(list2)
g2 = as.undirected(g)
#Plotting the igraph object with edge widths proportional to link weights
plot(g2,
edge.width = E(g2)$weight)
結果是一個古怪的網,鏈接權重是太大的區別。如何在最小 - 最大範圍內繪製這些邊緣,使網絡看起來更好?
非常感謝。
謝謝!它非常完美! – Marco