钢铁雄心3吧 关注:108,188贴子:2,328,074
  • 9回复贴,共1

吧里有懂R语言的嘛

只看楼主收藏回复

想问以下,为啥我这个图的图例不显示颜色?谢谢!
图:

代码:

数据长这样

代码文本:
ggplot(data=result.eff[result.eff$r.gcf %in% c("GCFs(S)","C","N","D","P","T"),])+
aes(x = mean, y = r.gcf, fill = r.obj, color = r.c)+
geom_errorbarh(aes(xmin = down, xmax = up), height=0.5, size=0.7 ,position = position_dodge(width = -0.5))+
geom_point(size = 3, position = position_dodge(width = -0.5))+
geom_vline(xintercept = 0, linetype = "dashed", size= 0.7)+
theme_bw()+
theme(axis.title.y=element_blank())+
theme(legend.title=element_blank(),legend.text=element_text(family = "myFont", size = 14),legend.justification=c(.95,0), legend.position=c(.95,0))+
theme(title=element_text(family = "myFont",size=14,),
axis.text.x = element_text(family = "myFont",size=12),
axis.text.y = element_text(family = "myFont",size=12))+
scale_y_discrete(limits = factor(c("GCFs(S)","C","N","D","P","T"), levels=c("GCFs(S)","C","N","D","P","T"))) +
labs(x = "Effect size")+
scale_x_continuous(limits=c(-1.65,1.65),breaks = c(-1.5,-1.0,-0.5,0,0.5,1.0,1.5))+
facet_wrap(vars(r.gro))+
theme(strip.text.x = element_text(family = "myFont",size=14))


IP属地:辽宁1楼2020-08-24 21:32回复
    虽然不懂 还是帮 仓鼠 昵称顶一下


    IP属地:山西来自Android客户端3楼2020-08-24 22:48
    回复
      14级大佬!!!


      IP属地:湖北来自Android客户端4楼2020-08-25 15:44
      收起回复
        帮大佬顶顶


        IP属地:浙江来自Android客户端5楼2020-08-25 21:24
        回复
          帮顶


          IP属地:天津来自Android客户端6楼2020-08-25 23:47
          回复