I have data like this, with following plotting of the data (inspired from this post):
x_val <- 0:250
y_val <- c(seq(0,1, 0.1), 1:10)
set.seed(1234)
data <- data.frame(x = sample(x_val, 30, replace = TRUE),
y = sample(y_val, 30, replace = TRUE))
library(ggplot2)
p <- ggplot(data, aes(x, y)) + geom_point()
p + scale_y_continuous(breaks = seq(0, 10, by = 1))
I wish to have half of the y-axis from 0 to 1, and the other half of the y-axis from 1 to 10. Any way of doing this?
Attempts:
I tried
scale_y_continuous(breaks = c(seq(0, 1, 0.1), seq(1, 10, 1)))
, but it does not work. I'm puzzled as to how to attack this.
EDIT: Just for clarity, I desire the following plot