[R] Patterns in histogram

dbeest detebeest at hotmail.com
Thu Jan 7 16:42:25 CET 2010


I’ve been busy making some histograms and I would like to distinguish
different groups. I’ve been doing it like this: 

a <- c(1,1,1,1,2,2,2)
hist(a,breaks=c(0,1,2))
hist(a[3:5],breaks=c(0,1,2),col="red",add=TRUE)

Basically plotting them over each other, I assume there is a better
way…Anyway what I want to do is make them in grayscale which essentially
means giving different groups patterns. I’ve been playing around with
“density” and “angle”

a <- c(1,1,1,1,2,2,2)
hist(a,breaks=c(0,1,2))
hist(a[3:5],breaks=c(0,1,2),add=TRUE,,density=3,angle=9)

Although you can make many different combinations with these I wondered if
there are “patterns” (dots for example) available in the similar fashion as
the colors (col="red" or pattern="dots")

cheers,

Dennis
-- 
View this message in context: http://n4.nabble.com/Patterns-in-histogram-tp1008928p1008928.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list