SHARE
TWEET

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

a guest Feb 22nd, 2012 13 Never
  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)
RAW Paste Data
Top