I'd like to put legend and more values in x limits.
test <- data.frame(x = runif(10), y = runif(10), mean_y = 0.1)
ggplot(test, aes(x = x, y = y)) + geom_point(color = 'red') +
geom_line(aes(x, mean_y))
I'd like to put legend and more values in x limits.
test <- data.frame(x = runif(10), y = runif(10), mean_y = 0.1)
ggplot(test, aes(x = x, y = y)) + geom_point(color = 'red') +
geom_line(aes(x, mean_y))
Your question needs a bit more explanation and a reproducible example, but to get "more values in x limits" you can try adding
+ expand_limits(x = c(1, 1000))
Just replace the values in the vector by the ones that actually fit your needs.