I have made a graph using ggplot and facet wrap to show my data across 3 different years. I am trying to remove the top and right border so each of the graphs have border only on the y and x axis. Here is my code for the graph
ggplot(dets_per_month, aes(x = month, y = ave)) +
geom_bar(aes(fill = zone), position = "dodge", stat = "identity") +
scale_fill_viridis_d(option = "plasma", name = "Zone") +
ylim(0,3700) +
xlab("Month") +
ylab("Avergae Detections") +
facet_wrap(vars(yearcollected),
strip.position = "top") +
facet_grid(yearcollected ~ .) +
theme_bw() +
theme(panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background = element_blank(),
axis.line = element_line(),
panel.border = element_line(),
strip.text = element_text(size = 10, face = "bold"),
strip.background = element_rect(fill = "white", colour = "white"))
I've been playing around with panel.border
but I can't seem to get the output I'm looking for.
Here is what my graph looks like with this code:
Does anyone know how to control the number and placement of borders in facet wrap?