I used this Question (ggplot scale color gradient to range outside of data range) to create a gradient within a specific range but now I have the problem, that all colors outside these limits are grey. I mean, it is logic to me but I wanted to have those to have the same color as the closest point.
ggplot(data.frame(a=1:10), aes(1, a, color=a)) +
geom_point(size=6) +
scale_colour_gradientn(colours=c('red','yellow','green'), limits=c(2,8))
So the top points should be green and the lower point should be red as well.
So what I am looking for is a range like limits=c(<2,>8)
but I know this is not working