Skip to content
Prev 314003 / 398513 Next

axes labeling

It is possible, but only by using axis() since you can specify axis breaks
in a plot command, but not the labels. You can ignore most of the axis()
options so the commands are pretty simple:

plot(x=c(1, 1000000), y=c(1, 1000000), xlab="x", ylab="y", 
     xaxt="n", yaxt="n", las=2)
pos <- c(0, 200000, 400000, 600000, 800000, 1000000)
lbl <- c("0", "200k", "400k", "600k", "800k", "1000k")
axis(1, pos, lbl)
axis(2, pos, lbl)
# or axis(2, pos, lbl, las=2) to rotate the y tick mark labels.

----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352