I created a histogram with ggplot2 in R and need a logarithmically spaced x-axis, but would like to keep my linear values.
Is this possible?
My formula so far is:
ggplot(f0peruttnq, aes(f0)) +
geom_histogram(alpha=0.3, fill='white', colour='black')
Slightly off-topic: I also tried to superimpose a normal curve on top of my histogram, but geom_density() doesn't seem to work if I want to keep my counts instead of density values on the x-axis. As I tried + stat_function( fun = dnorm ) nothing changed at all!
Thanks in advance for any useful tips!
It's working now!
Formula I used:
ggplot(data, aes(V2)) + geom_histogram(alpha=0.3, fill='white', colour='black')+scale_x_log10(breaks=c(50,100,150,200,250),labels=c(50,100,150,200,250))
Thanks for your patience :-)