-
Notifications
You must be signed in to change notification settings - Fork 167
Closed
Description
I have two ggraphs to patch.
library(tidygraph)
library(ggraph)
g1 <- gsi_wave1 %N>%
mutate(degree_sum = centrality_degree(mode = "all")) %>%
ggraph(layout = "kk") +
geom_edge_link(aes(alpha = 0.5),
# Add arrow points
arrow = arrow(length = unit(1, "mm")),
start_cap = circle(0.5, "mm"),
end_cap = circle(0.5, "mm")) +
geom_node_point(aes(color = degree_sum,
alpha = 0.8)) +
scale_color_viridis(discrete = FALSE, option = "D") +
theme_void() +
ggtitle("GSI Network in wave 1 (2008-2010)")
g2 <- gsi_wave3 %N>%
mutate(degree_sum = centrality_degree(mode = "all")) %>%
ggraph(layout = "kk") +
geom_edge_link(aes(alpha = 0.5),
# Add arrow points
arrow = arrow(length = unit(1, "mm")),
start_cap = circle(0.5, "mm"),
end_cap = circle(0.5, "mm")) +
geom_node_point(aes(color = degree_sum,
alpha = 0.8)) +
scale_color_viridis(discrete = FALSE, option = "D") +
theme_void() +
ggtitle("GSI Network in wave 3 (2015-2017)")
library(patchwork)
g1 + g2 + plot_layout(guides = 'collect') & theme(legend.position = 'bottom')The patched plot shows a collected legend in a vertical format.

How can I get a collected legend in a horizontal format as in the individual graph?
wvictor14DanChaltiel
Metadata
Metadata
Assignees
Labels
No labels