This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

How can I make my vertical labels fit within my plotting window

By: a guest on Feb 22nd, 2012  |  syntax: None  |  size: 0.56 KB  |  views: 13  |  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. hist(vector, axes = FALSE, breaks = chartBreaks)
  2. axis(1, at = tickMarks, labels = eventTypes, las = 2, tick = FALSE)
  3.        
  4. set.seed(123)
  5. vec <- sample(1:9, 100, replace = TRUE)
  6. vec <- factor(vec, labels = paste("My long event name", 1:9))
  7.        
  8. ## lots of extra space in the margin for side 1
  9. op <- par(mar = c(10,4,4,2) + 0.1)
  10. barplot(table(vec), las = 2)
  11. par(op) ## reset
  12.        
  13. dotchart(table(vec))
  14.        
  15. par(mar=c(5,3,1,1))   # extra large bottom margin
  16. hist(vector, axes = FALSE, breaks = chartBreaks)
  17. axis(1, at = tickMarks, labels = eventTypes, las = 2, tick = FALSE)
clone this paste RAW Paste Data