Is there a way to make breaks in my histogram axis if I have values much larger from the rest of my data?
For example using the following dummy data to make a ggplot histogram:
test_data <- c(1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,100,100,50,5000)
df = data.frame(test_data)
ggplot(df, aes(test_data))+geom_histogram()
Yields a histogram with a large gap
I would love for the x-axis to have bins from 0 to 1000 then a cut then continue from 4000 on. How can I achieve this?
UPDATE
The linked "duplicate" has broken images and even after trying out their suggestions, I did not achieve what I want. I tried
geom_histogram(breaks=c(seq(1, 100, by=1),seq(200,1000,by=100), seq(2000,5000, by=1000))
But this gives huge, wide bars and that is not what I want.