How can I add a second legend for the shape aesthetics in ggplot?
The chart shows different start types (shape), different processes (color), and different end types (shape again). Currently, I am only able to display two legends: one for the color and one for the shape (which merges start.type and end.tpye). Any help on how to get the separate third legend (for the end.type)? Introducing linetype as an additional aesthetics is not an option. Many thanks.
id <- c("1","2","3")
start.date <- c("01/01/2010","05/05/2004","01/08/2006")
end.date <- c("31/12/2012","05/05/2007","01/09/2009")
start.type <- c("x1","x2","x3")
end.type <- c("y1","y2","y3")
process.type <- c("p1","p2","p3")
u <- data.frame(id,start.date, end.date,start.type,end.type,process.type)
u.plot <- ggplot(u)+
geom_segment(aes(color=process.type, x=start.date, xend=end.date, y=id, yend=id), size=1)+
geom_point(aes(shape=start.type, x=start.date, y=id), size=3)+
geom_point(aes(shape=end.type, x=end.date, y=id), size=3)
plot(u.plot)