Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce geom_edge_arc height #283

Closed
taleac opened this issue Mar 1, 2021 · 1 comment
Closed

reduce geom_edge_arc height #283

taleac opened this issue Mar 1, 2021 · 1 comment

Comments

@taleac
Copy link

taleac commented Mar 1, 2021

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants