plot - gauss curve in R, resizing the x axis to SD -


i plot histogram , resize x axis standard deviation (sd) value. if plot just:

hist(df) 

the x axis show real values.

my histogram

the sd of these values = 0.38. convert x axis sd size, -1 sd in histogram equal -0.38.

cheers

try this:

set.seed(1) x <- rnorm(1000) hist(x, col='red', xaxt='n') # exclude x-axis  # manually specify axis m <- c(-3,-2,-1,0,1,2,3) s <- m*sd(x) l <- paste(m,'sd') l[4] <- '0' axis(1, s, l) 

enter image description here


Comments

Popular posts from this blog

javascript - How to name a jQuery function to make a browser's back button work? -

python - Django-easy-pdf: xhtml2pdf reporting reportlab 2.2+ is required, but 3.0 installed -

collision detection - C++ library for mesh to mesh intersection: what is available? -