Issue:
I have done a lot of research and tried many different solutions and I could not find an answer to my problem, at least not one that worked for me. I am attempting to place the legend title 'Species' above the horizontally placed legend positioned at the top of a barplot (see below) and for it to be centred.
For instance:
CodePudding user response:
If you switch to guides(fill = ...)
you should be able do it.
Try:
guides(fill = guide_legend(title.position = "top", title.hjust=0.5)
(thanks to @teunbrand, for minor correction)