[R] Help needed: Fraction for Histogram > 1 ???

charles78 huz88 at hotmail.com
Tue Jun 23 15:51:01 CEST 2009


I change the values by multiple 100 (from fraction to percentage) and then
use the same code draw the hist.  Now it works fine.  The y axis labeled
between 0 and 0.05.

Why using fraction (value between 0 and 1) it does not work?

Charles

charles78 wrote:
> 
> I have been trying to draw histogram for my manscript and found some
> strange things that I could not figure out why.
> 
> Using the same code listed below I have successfully draw histograms for a
> few figures with fraction labeled on Y axis less than 1 (acturally between
> 0 to 0.1).  But one dataset gives the Y axis label 0 to 5 as fraction. 
> This is not true, as fraction are less than 1, although the value
> distribution on the figure seems to me is right.
> 
> The only difference between the first few datasets and last dataset is:
> 
> All values for the first few data sets > 1.
> 
> The values for the last data sets between 0 and <1.
> 
> Any idea why this happens.
> 
> Your help is highly appreciated.  
> 
> Charles
> 
> ===================================================
> postscript("Figure.eps", paper="letter", horizontal=FALSE)
> par(mfrow=c(3,3))
> par(omi=c(2,0.2,1.8,0.2), mai=c(0.4, 0.4, 0.5, 0.1) )
> 
> my.input <- read.table("input.data", header=FALSE, sep="\t")
> my.input.exp <- read.table("exp.data", header=FALSE, sep="\t")
> 
> hist(my.input.exp[,2], breaks=40,freq = FALSE,xlab="", border = "grey30",
> ylab="", main="")
> hist(my.input[,2], breaks=40,freq = FALSE,xlab="", ylab="", main="",
> border = "red",add =TRUE)
> mtext("Fraction", side=2, line=2, cex=0.7)
> box()
> ======================================================
> 

-- 
View this message in context: http://www.nabble.com/Help-needed%3A-Fraction-for-Histogram-%3E-1-----tp24150345p24166484.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list