Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- types <- c("Conqueror","Manager","Wanderer","Participant","Overall")
- mycolors <- c(rgb(0.1,0.1,0.1), rgb(0.5,0.5,0.5), rgb(0.8,0.8,0.8))
- har <- c(7,9,12,23,11)
- cas <- c(40,30,31,56,37)
- ctrl <- c(33,31,63,66,50)
- data <- rbind(har,cas,ctrl)
- #adjust margins
- par(mar=c(2.5,4.5,1,1))
- # http://stat.ethz.ch/R-manual/R-patched/library/graphics/html/barplot.html
- barplot(data, beside=TRUE,
- ylab="Percent of women in each category",
- names.arg=types, ylim=c(0,70), col=mycolors)
- # grid only in y-direction
- # http://stat.ethz.ch/R-manual/R-patched/library/graphics/html/grid.html
- grid(NA, 7)
- # legend at the top-left corner
- legend("topleft", c("DGD1 Hardcore","DGD1 Casual","Control"), cex=1.3, bty="n", fill=mycolors);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement