DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Create Rotated Axis Labels

07.08.2005
| 4292 views |
  • submit to reddit
        The R FAQ states:
 
par(mar = c(7, 4, 4, 2) + 0.1)
plot(1 : 30, xaxt = "n",  xlab = "")
labels <- paste("Label", 1:30, sep = " ")
text(1:30, par("usr")[3] - 0.25, srt = 90, adj = 1,labels = labels, xpd = TRUE)
mtext(1, text = "X Axis Label", line = 6)

Also see Figure 1 and associated code in Paul Murrell (2003), “Integrating grid Graphics Output with Base Graphics Output�, R News, 3/2, 7–12.