I have the data frame One_APD
:
One_APD = structure(list(Amplification = c(108.91, 120.765, 134.875, 151.877, 172.812, 199.324), Voltage = c(351.955, 353.954, 355.956, 357.955, 359.947, 361.948), pred = c(1.54580502813059, 1.56713437847747, 1.58992216028315, 1.61410007849728, 1.63960908075698, 1.66665619275778)), .Names = c("Amplification", "Voltage", "pred"), row.names = c(NA, -6L), class = c("grouped_df", "tbl_df", "tbl", "data.frame"))
And it looks like this:
> One_APD
Amplification Voltage pred
1 108.910 351.955 1.545805
2 120.765 353.954 1.567134
3 134.875 355.956 1.589922
4 151.877 357.955 1.614100
5 172.812 359.947 1.639609
6 199.324 361.948 1.666656
and plotted it as following:
ggplot(One_APD, aes(x = Voltage, y = log(log(Amplification)))) +
geom_point(size=3, colour="blue") +
geom_line(aes(y = pred), size=2, alpha=0.3, colour="red")
which looks like:
I would like to add a legend which names the blue points and the red curve. As far as I see all legend commands aim at fill or colour in the aes of ggplot. But I don't provide fill or colour because it makes no sense to assign colour or fill.. How can I add corresponding legends to the data in the plot?
edit: Solution is in Construct a manual legend for a complicated plot