Manual Scale in ggplot2
October 5, 2016
If you are want to use ggplot2 to plot two different data frames, you probably want the two data frames to be represented by different colors. Using the geom_point function, you can easily assign different colors to the different sets of data, but creating a legend for two different data frames in one ggplot is more less intuitive.
The code below explains how to take two data frames and plot them together with a legend that explains the colors for each of the data sets. This code uses teh scale_colour_manual function from ggplot2.