Unfortunately the author didn't use defined theme inside the function, so if you want to not mess up the other customizations in place, this should work:
p <- plot(cooccur.finches)
p + theme_bw(base_size = 28) +
theme(axis.text = element_blank(),
axis.ticks = element_blank(),
plot.title = element_text(vjust = -4, face = "bold"),
panel.background = element_rect(fill = "white", colour = "white"),
panel.grid = element_blank()
legend.position = c(0.9, 0.5))
You can also use this code to set the size of the legend or title independently, e.g.
p + theme(plot.title = element_text(vjust = -4, face = "bold", size = 36))
Most unfortunately, this won't change the size of the species labels because they are set with geom_text()
. To alter them, you'll have to hack the function yourself cooccur:::plot.cooccur
. You only need to modify the last line:
p + geom_text(data = dfids, aes(label = X1), hjust = 1, vjust = 0,
angle = -22.5)
# change to
p + geom_text(data = dfids, aes(label = X1), hjust = 1, vjust = 0,
angle = -22.5, size = 24)