Dear stack overflow readers,
I am having a dataset for which I have "raw" data and for which I additionally compute some kind of smoothing function for. I then want to plot the raw data as points, and the smoothing as a line. This works with the following:
Loc <- seq(from=1,to=50)
Loc <- append(Loc,Loc)
x <- seq(from=0,to=45,by=0.01)
Val <- sample(x,100)
labels <- NULL
labels[1:50] <- 'one'
labels[51:100] <- 'two'
x2 <- seq(from=12,to=32,by=0.01)
Val2 <- sample(x2,100)
raw <- data.frame(loc=Loc,value=Val,lab=labels)
smooth <- data.frame(loc=Loc,value=Val2,lab=labels)
pl <- ggplot(raw,aes(loc,value,colour=lab)) + geom_point() + geom_line(data=smooth)
print(pl)
The result looks like this:
The problem is that my actual data contains so many data points that using the same colour palette is going to be very confusing (the difference between point and line will be almost indistinguishable). Preferably, I would make the geom_lines() slightly darker. I've tried with scale_colour_hue(l=40)
, but that results in the the geom_points() to be darker as well.
Thanks for any suggestions!