Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate a histogram with exponentially increasing bin width by ggplot

Tags:

r

ggplot2

I have not found a way to display an histogram with increasing binwidth in ggplot. Is there a way?

like image 271
Bendaua Avatar asked Dec 11 '25 23:12

Bendaua


1 Answers

I found it myself:

breeaks <- c(0,1,2*2^(0:10))
mygg <- ggplot(Grains, aes(Shape_Area)) + theme_bw() + xlab("Size") + geom_histogram(breaks = breeaks, col =3)
mygg

gives:

exponential increasing bin width

like image 73
Bendaua Avatar answered Dec 13 '25 15:12

Bendaua



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!