thomasp85 / ggraph

Grammar of Graph Graphics
https://ggraph.data-imaginist.com
Other
1.08k stars 116 forks source link

reduce geom_edge_arc height #283

Closed taleac closed 10 months ago

taleac commented 3 years ago

I am trying to adjust a graph so that the labels are not cut off at the bottom, but when I increase the vertical height, the arcs for my edges simply take up the extra space. How can I modify this code to (1) not cut off the labels at the bottom and (2) reduce the arc height?

I am also hoping to color each link according to the "to" value for the edge, any assistance is appreciated!

png('links.png', height=10000, width=10000, res = 600) ggraph(net_tidy, layout = "linear", circular = FALSE) + geom_edge_arc(aes(width = weight/2), alpha = 0.5) + scale_edge_width(range = c(0.2, 2)) + geom_node_text(check_overlap = TRUE, repel = FALSE, nudge_y = -.1, aes(label = label, angle = 90, hjust = 1)) + labs(edge_width = "Agreement") + theme(text = element_text(size = 20), legend.position="none", legend.title = element_blank()) dev.off()

links

thomasp85 commented 10 months ago

Belated answer, but you could use the expand_limits() function from ggplot2 to increase padding on the y-axis