Here are the codes:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Random numbers | |
h2<-rnorm(1000,4) | |
h1<-rnorm(1000,6) | |
# Histogram Grey Color | |
hist(h1, col=rgb(0.1,0.1,0.1,0.5),xlim=c(0,10), ylim=c(0,200), main="Overlapping Histogram") | |
hist(h2, col=rgb(0.8,0.8,0.8,0.5), add=T) | |
box() | |
# Histogram Colored (blue and red) | |
hist(h1, col=rgb(1,0,0,0.5),xlim=c(0,10), ylim=c(0,200), main="Overlapping Histogram", xlab="Variable") | |
hist(h2, col=rgb(0,0,1,0.5), add=T) | |
box() |