ggplot中的图例问题

时间:2018-04-10 08:50:18

标签: r ggplot2

我想手动为情节创建图例。创建绘图的脚本如下:

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")

此脚本创建的图: enter image description here

我想要的是如下图所示的传奇(在photoshop中制作) enter image description here

这不是一个重复的问题!在针对此问题的不同问题中应用解决方案时,我没有得到任何结果!

0 个答案:

没有答案