R 同一绘图ggplot2中的不同图例位置

R 同一绘图ggplot2中的不同图例位置,r,ggplot2,R,Ggplot2,是否可能在同一绘图中有不同的图例位置 目前,我正在使用 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=

是否可能在同一绘图中有不同的图例位置 目前,我正在使用

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")
库(ggplot2)
p1 1.3,“x”和“(x)+
刻度尺寸连续(范围=c(2,18),极限=c(0,25),断点=c(1.3,序号(2,最大值(grs$logp),乘以=2)))+
比例颜色梯度n(name=“Beta”,限值=c(-0.5,0.5),颜色=topo.colors(4))+
比例y离散(“GRS”)+
主题(
panel.background=element_rect(fill=“#696868”,color=“orange”,size=2)
)+
主题(panel.grid.major=element_line(color=“black”,linetype=“虚线”))+
主题(axis.text=bold.12.text)+
主题(axis.text.x=element\u blank(),axis.ticks.x=element\u blank())+
主题(axis.title.x=element\u blank())+
主题(legend.position=“bottom”)

您忘记包含对象
grs
以满足可复制示例要求此处的一些选项:您忘记包含对象
grs
以满足可复制示例要求此处的一些选项: