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

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

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