Advertisement
Guest User

bar plot of ratio of women in DGD1 data and control pop

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