虽然手册指出这将是未来的功能:
arrow.size箭头的大小.目前这是一个常数,所以每个边缘都是一样的.如果提交了一个向量,那么只使用第一个元素,即.如果这是从边缘属性获取的,那么只有第一条边的属性用于所有箭头.这可能会在未来发生变化.
默认值为1.
我想知道是否有一个黑客围绕允许箭头大小匹配边缘宽度(每个边缘有自己的宽度).
d <- data.frame(start=c("a","a","b","c"),end=c("b","b","c","b"), size=rnorm(4))
graph <- graph.data.frame(d, directed=T)
plot(graph,
vertex.color="white",
edge.width=E(graph)$size*20,
edge.arrow.size=E(graph)$size)
Run Code Online (Sandbox Code Playgroud)

Gab*_*rdi 11
好吧,有一个黑客,你需要绘制图形的次数与不同边缘宽度的数量,并且每次只绘制边缘的给定子集,使用"右"箭头大小.使用add=TRUE参数将它们绘制在一起.也许你也想只绘制一次顶点.
顺便说一句.您可以在https://github.com/igraph/igraph/issues上提交功能请求
library(igraph)
## (almost) your example data
d <- data.frame(start=c("a","a","b","c"),
end=c("b","b","c","b"),
size=1:4)
graph <- graph.data.frame(d, directed=TRUE)
## The plotting function
eqarrowPlot <- function(graph, layout, edge.lty=rep(1, ecount(graph)),
edge.arrow.size=rep(1, ecount(graph)),
vertex.shape="circle",
edge.curved=autocurve.edges(graph), ...) {
plot(graph, edge.lty=0, edge.arrow.size=0, layout=layout,
vertex.shape="none")
for (e in seq_len(ecount(graph))) {
graph2 <- delete.edges(graph, E(graph)[(1:ecount(graph))[-e]])
plot(graph2, edge.lty=edge.lty[e], edge.arrow.size=edge.arrow.size[e],
edge.curved=edge.curved[e], layout=layout, vertex.shape="none",
vertex.label=NA, add=TRUE, ...)
}
plot(graph, edge.lty=0, edge.arrow.size=0, layout=layout,
vertex.shape=vertex.shape, add=TRUE, ...)
invisible(NULL)
}
## Test
eqarrowPlot(graph, layout.auto(graph), edge.arrow.size=E(graph)$size/3,
edge.width=E(graph)$size)
Run Code Online (Sandbox Code Playgroud)

但是很宽的边缘看起来很糟糕.