Tôi đang cố gắng giữ cho chú giải của một lớp (mịn) và loại bỏ chú thích của điểm khác (điểm) bằng đối số show.legend nhưng chú giải gậy. Đây là mã:xoá chú thích ggplot 2.2
ggplot(a[a$variable=="ratio1",], aes(x=new.cor1, y=value))+
geom_point(aes(x=new.cor1, y=value, color=mntn1...1., show.legend=F), size=0.001)+
geom_point(data=tbl1.cnds1, aes(x=new.cor1.cnds, y=ratio1.cnds), shape=5)+
geom_smooth(data=a, aes(x=new.cor1, y=value, colour=variable, show.legend=T),
size=0.5, span=0.05, show.legend=T)+
labs(title="Manhattan plot", x="position", y="zygosity score", colour = "", fill="")+
theme(axis.text.x = element_text(size=11),
axis.text.y = element_text(size=18),
legend.text=element_text(size=17),
legend.key.size = unit(1, "cm"),
plot.title=element_text(size=25, vjust=3),
plot.margin = unit(c(1,0.9,1,1), "cm"),
axis.text=element_text(size=10),
axis.title = element_text(size=24),
axis.title.y=element_text(margin=margin(r = 13)),
axis.title.x=element_text(margin = margin(t = 10)))+
scale_y_continuous(limits = c(0, 1))+
scale_x_continuous(breaks=breaks, labels=labels)+
geom_text(data=tbl1.cnds1, aes(x=new.cor1.cnds, y=ratio1.cnds, label=cnds.gene),
size=2, hjust=-0.2)+
guides(colour=FALSE)
Một ví dụ tái sản xuất tối thiểu sẽ đơn giản hơn nhiều. Trong dòng mã dài dường như có rất nhiều mã không cần thiết (với vấn đề ở bàn tay) cũng như nó hoàn toàn không thể sản xuất được vì nó hiện đang được viết. – mnel