我不知道为什么scale_fill_manual不能在这里工作,而scale_shape_manual和scale_colour_manual可以。我已经搜索过了,但都没有解决这个问题。R代码:
ggplot(Alltable,aes(x=Alltable$feature,
y=Alltable$data.Nonsynonymous.tumor.mutation.burden,
fill=Alltable$feature,
shape=Alltable$feature,colour=Alltable$feature))+
labs(x='',y='Tumor mutation burden')+
theme_classic()+
geom_boxplot(fill="white",color="black",lwd=1)+
geom_quasirandom(size=1.5,width=0.3,varwidth=T)+
scale_colour_manual(values=c("CR/PR"<-"blue","SD/PD"<-"red","DCB"<-"green3","NDB"<-"purple"))+
scale_shape_manual(values=c("CR/PR"=1,"SD/PD"=0,"DCB"=6,"NDB"=5))+
scale_fill_manual(values=c("CR/PR"<-"blue","SD/PD"<-"red","DCB"<-"green3","NDB"<-"purple"))+
theme(legend.position="none")发布于 2018-10-30 02:06:08
我想通了!在scale_shape_manual(values=c("CR/PR"=1,"SD/PD"=0,"DCB"=6,"NDB"=5))中,形状是中空的。更改为scale_shape_manual(values=c("CR/PR"=21,"SD/PD"=22,"DCB"=25,"NDB"=23))就可以了。
https://stackoverflow.com/questions/53051118
复制相似问题