[R] Histogram plot help

YAddo linkyox at gmail.com
Mon Dec 3 23:21:35 CET 2012


Dear All:

I plotted a histogram with Abline, clipping with color codes but i run into
some problems.   The "abline' does not show up at all,  and when i request
the 'prob=True' (to obtain the freqs), my clipped region colors the section
of the graph instead of the plot only.

Is there any way i can get the y-axis figures  to be in whole numbers rather
than decimals? 

Many thanks for your help.
YA

Here are the working codes i am tweaking.

Everything worked fine before i trying adding stuffs (prob=T, etc).


x <- rnorm(1000)
hist(x, xlim=c(-4,4),ylab="Prevalence",prob=T,lwd=3,las=1)
lines(density(x),col="black",lwd=2)
usr <- par("usr")
clip(usr[1], -2, usr[3], usr[4])
hist(x, col = 'red', add = TRUE)
clip(2, usr[2], usr[3], usr[4])
hist(x, col = 'blue', add = TRUE)
abline(v=c(-1),lty=1,lwd=3,col="black")
do.call("clip", as.list(usr))  # reset to plot region





--
View this message in context: http://r.789695.n4.nabble.com/Histogram-plot-help-tp4651958.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list