是否可以在同一图中具有不同的图例位置 目前,我正在使用
theme(legend.position="bottom")
但我有两个传说,想要向右移动一个,另一个留在底部。
library(ggplot2)
p1 <- ggplot(grs, aes(x=grs$Pheno, y=grs$Type, weight=logp, colour=grs$Beta,size=logp))+
geom_point(shape=15)+
geom_text(data=grs,size=4,color="black",mapping=aes(x=Pheno,y=Type,label=ifelse(logp>1.3,"x",'')))+
scale_size_continuous(range=c(2,18),limits = c(0,25),breaks = c(1.3,seq(2,max(grs$logp),by = 2)))+
scale_colour_gradientn(name="Beta",limits=c(-0.5, 0.5),colours = topo.colors(4))+
scale_y_discrete("GRS")+
theme(
panel.background = element_rect(fill = "#696868", color = "orange", size = 2)
)+
theme(panel.grid.major = element_line(colour = "black",linetype = "dotted"))+
theme(axis.text=bold.12.text)+
theme(axis.text.x=element_blank(),axis.ticks.x=element_blank())+
theme(axis.title.x=element_blank())+
theme(legend.position="bottom")