Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.64 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. x-axis labels do not match bars
  2. test <- as.matrix(read.csv(file="test4.csv",sep=",",head=TRUE))
  3. test <- test[,2:ncol(test)]
  4. pdf(file="test.pdf", height=4, width=6)
  5. par(lwd = 0.3)
  6. barplot(test, space=0.4, xaxt='n', ann=FALSE)
  7. axis(1, cex.axis=0.25, las=2, at=1:ncol(test), space=0.4, labels=colnames(test))
  8. dev.off()
  9.        
  10. xLabLocs <- barplot(test, space=0.4, xaxt='n', ann=FALSE)
  11. axis(1, cex.axis=0.25, las=2, at=xLabLocs,
  12.      space=0.4, labels=colnames(test))
  13.        
  14. Value:
  15.      A numeric vector (or matrix, when ‘beside = TRUE’), say ‘mp’,
  16.      giving the coordinates of _all_ the bar midpoints drawn, useful
  17.      for adding to the graph.