How to create a legend for ggplot

2 posts were split to a new topic: add a legend to a ggplot2 plot