I want to manually create a legend for a plot. The script to create the plot is as follows:
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")
What I would like is a legend like the following figure (made in photoshop)
This is not a duplicate question! I'm not getting anything when applied the solutions in different questions regarding this issue!