Our organization has a very exacting style book, so I've been tasked with creating a ggplot theme that programmers can use to ensure that their charts and graphs are as close as possible to "official" style.
One of the requirements is that the legend for a graph be below the graph, but vertically stacked, like this:
I've been generating graphics like this in the following way:
pie_theme <- theme(
text = element_text(family = "Arial", face = "bold", size = 7, color = "black"),
plot.caption = element_text(hjust = 0, size = 6),
legend.position = "bottom",
etc.
)
p1 <- ggplot(bla bla bla)+geom_bar(bla bla bla)+coord_polar(bla bla bla)
p1+ guides(fill=guide_legend(ncol=1)) +
pie_theme
Ideally, I'd like to integrate the guides() command into the theme so that programmers don't have to add the guides() every time they output a chart and the legend automatically stacks vertically. But I don't see a theme() attribute that will do that. Any advice?
Thank you!