livia wrote: > Hi, I would like to plot a histogram with the following codes, and I would > like to make the tick intervals smaller. I tried to add "lab=c(1,1,12)", but > nothing changes. > > > par(mfrow=c(1,1),font=1, cex=0.8) > hist (data1, seq(-0.01,0.3,0.01),freq = FALSE, > main="Figure1.",xlab="return",lab=c(1,1,12)) > lines(density(data1), col="blue") > Hi Livia, From the look of your example, I suspect you may want more labels for the 31 bars of your histogram. The following will give you many more labels that don't overlap:
library(plotrix) hist (data1, seq(-0.01,0.3,0.01),freq = FALSE, main="Figure1.",xlab="return",lab=c(1,1,12),xaxt="n") staxlab(1,at=seq(-0.01,0.3,by=0.02),labels=seq(-0.01,0.3,by=0.02)) Jim ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.