编辑 我试图弄清楚我的代码出了什么问题,我开始绘制简单的图形以查看箭头在较小图形上的显示方式。我累了下面的命令:使用igraph绘制网络时的巨大箭头
g2 <- graph(edges=c(1,2, 2,3, 3, 1), n=10)
plot(g2)
这是我的图:。因此,我认为问题不在于我的代码,而在于使用igraph或R。我重新安装了两者,igraph和R,但它没有解决问题。是否有导致这种情况的软件包冲突?下面是一个点燃的包,我已经安装:
[1] "base" "boot" "class" "cluster"
[5] "codetools" "colorspace" "compiler" "datasets"
[9] "dichromat" "digest" "doParallel" "foreach"
[13] "foreign" "graphics" "grDevices" "grid"
[17] "gridBase" "gtable" "igraph" "irlba"
[21] "iterators" "KernSmooth" "labeling" "lattice"
[25] "lazyeval" "magrittr" "MASS" "Matrix"
[29] "methods" "mgcv" "munsell" "nlme"
[33] "NMF" "nnet" "parallel" "pkgmaker"
[37] "plyr" "RColorBrewer" "Rcpp" "registry"
[41] "reshape2" "rngtools" "rpart" "scales"
[45] "spatial" "splines" "stats" "stats4"
[49] "stringi" "stringr" "survival" "tcltk"
[53] "tibble" "tools" "utils" "xtable"
我想产生一个网络的情节,由于某种原因,我在我的箭头模样的小矩形,而不是通常的三角箭头。
这里是我用我的绘图代码:
toy.edges <- na.omit(read.csv("Data/Edge_list-toy.csv", header = TRUE, colClasses = "numeric", na.strings = c("NA", "", "#N/A")))
toy.nodes <- na.omit(read.csv("Data/NodesDataF-toy.csv", header = TRUE, na.strings = c("NA", "", "#N/A")))
toy.graph <- graph_from_data_frame(toy.edges, directed = TRUE, vertices = toy.nodes)
V(toy.graph)$color <- "magenta"
V(toy.graph)$shape <- "sphere"
V(toy.graph)$size <- 3*15^(ifelse(is.na(V(toy.graph)$node.size), 0.001,
V(toy.graph)$node.size))
plot(toy.graph, layout = layout.fruchterman.reingold(toy.graph),
vertex.label=NA, edge.width=E(toy.graph)$weight,
edge.arrow.size=0.005, edge.arrow.width=0.0000001)
而且这里有一个例子情节:
它,当我需要稍微大一点的值edge.arrow.size
看起来更糟 和edge.arrow.width
。
我的代码有什么问题?它可以与R的版本有关吗?我之前制作了大量的剧情,使用了非常相似的命令,而且我从来没有遇到过问题。
这里是与nodes info和edge list文件。