我想手动为情节创建图例。创建绘图的脚本如下:
ggplot(afr.ks)+
geom_segment(aes(y = Chr, yend = Chr, x = 0, xend = long), data = d.chr) +
geom_segment(aes(y = Chr, yend = Chr, x = pos1, xend = pos2), lwd = 3,
colour = "red3") + ylab("Chromosome") + xlab("Position (bp)")+
geom_segment(aes(y = chr, yend = chr, x = cen.pos1, xend = cen.pos2),data=positions, lwd = 3,
colour = "black")+scale_y_discrete( limits=c(1:22))+
geom_segment(aes(y = Chr, yend = Chr, x = pos1, xend = pos2),data=Af.KS.HHD.95, lwd = 3,
colour = "springgreen3")+
geom_segment(aes(y = Chr, yend = Chr, x = pos1, xend = pos2),data=Af.KS.HHD.100, lwd = 3,
colour = "springgreen4")
这不是一个重复的问题!在针对此问题的不同问题中应用解决方案时,我没有得到任何结果!