In: "How to plot barchart onto ggplot2 map" Inscaven has proposed an efficient way for adding barplot onto a map without using subplot library.
But how adding the legend for any barplot since theme(legend.position = "topright") does not work ?
In: "How to plot barchart onto ggplot2 map" Inscaven has proposed an efficient way for adding barplot onto a map without using subplot library.
But how adding the legend for any barplot since theme(legend.position = "topright") does not work ?
If you want to place the legend in the top right corner, instead of "topright"
you can specify a legend position as coordinates:
ggplot(...) + theme(legend.position = c(0.9, 0.9))
(0,0)
corresponds to the bottom left corner and (1,1)
is top right.