Consider the following MWE:
m <- matrix(c(1/4,2/4,1/4, 1/5,1/5,3/5, 3/6,1/6,2/6), ncol=3, byrow=T)
gg <- graph_from_adjacency_matrix(adjmatrix=m, weighted=TRUE, mode="directed", diag=T)
When using end_cap, as in the following, the edge widths are wrong:
ggraph(gg, layout = 'linear', circular=T) +
geom_edge_fan(aes(width=weight, label=round(weight,2)),
end_cap = circle(.5, 'cm'),
angle_calc='along', label_dodge=unit(-0.3, "cm")) +
geom_edge_loop(aes(width=weight, direction=rep(c(30,270,150),3), label=round(weight,2)),
end_cap = circle(.5, 'cm'),
angle_calc='along', label_dodge=unit(-0.3, "cm")) +
geom_node_point(size=12)
The edge widths are correct again if we remove the end_cap spec:
ggraph(gg, layout = 'linear', circular=T) +
geom_edge_fan(aes(width=weight, label=round(weight,2)),
#end_cap = circle(.5, 'cm'),
angle_calc='along', label_dodge=unit(-0.3, "cm")) +
geom_edge_loop(aes(width=weight, direction=rep(c(30,270,150),3), label=round(weight,2)),
#end_cap = circle(.5, 'cm'),
angle_calc='along', label_dodge=unit(-0.3, "cm")) +
geom_node_point(size=12)
Consider the following MWE:
m <- matrix(c(1/4,2/4,1/4, 1/5,1/5,3/5, 3/6,1/6,2/6), ncol=3, byrow=T)gg <- graph_from_adjacency_matrix(adjmatrix=m, weighted=TRUE, mode="directed", diag=T)When using
end_cap, as in the following, the edge widths are wrong:The edge widths are correct again if we remove the
end_capspec: