Make y-axis logarithmic in histogram using R [duplicate]
This question already has an answer here: Histogram with Logarithmic Scale and custom breaks 7 answers Hi I'm making histogram using R, but the number of Y axis is so large that I need to turn it into logarithmic.See below my script: hplot<-read.table("libl") hplot pdf("first_end") hist(hplot$V1, breaks=24, xlim=c(0,250000000), ylim=c(0,2000000),main="first end mapping", xlab="Coordinates") dev.off() So how should I change my script? thx You can save the histogram data to tweak it before plotting: set.seed(12345) x = rnorm(1000) hist.data = hist(x, plot=F) hist.data$counts = log10(hist.data