How can I create a plot with two legends, where one legend is vertical and the other legend horizontal?
Using an aperture dataset, here is an example:
ggplot(iris,aes(x=Sepal.Width,y=Petal.Width,color=Species,size=Sepal.Length))+
geom_point() +
scale_size_continuous(breaks=c(seq(from=5,to=7,by=0.4))) +
facet_wrap(~Species,ncol = 2) +
theme(legend.position=c(.7,.2))
I would like the legend of color to Speciesremain vertical, but above it there should be a horizontal inscription Sepal.Length. Is it possible?
Note. I understand that cutting makes color design unnecessary. I just use this as an example.
source
share