Monday, April 8, 2013

RG# 43: Histogram with colored tails


# data 
set.seed(1234)
 XV <- rnorm(2000, 15, 4)

# plotting 

 histgm <- hist(XV, breaks=100, plot=FALSE)

plot(histgm, col=ifelse(abs(histgm$breaks) < 10, "red", ifelse (abs(histgm$breaks) >20, "purple", "gray50")))


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.