I use R for generating most of my scientific graphics, and it generally does a pretty good job with the axes by default. However, you are given a lot of flexibility if you want to tweak things and get them “just right.”
Recently, I was plotting a distribution with a very large mean (in the hundreds of thousands range). Printing out something like
350000 every X-axis tick mark would have cluttered the graphic, so R by default printed the tick mark labels in scientific notation. It was definitely less cluttered, but also not very readable. I decided I would prefer labels like
350k rather than
axis command is what I needed. First, I set the
xaxt parameter to
n in the initial plot command using the to leave the X axis blank. I then used the axis command to specify where I wanted the axis printed (bottom), the size of intervals between tick marks, and how I wanted to print the labels. This was my final code.
plot(x, y, type='l', xaxt='n') axis(1, at = x <- seq(3.5e5, 8e5, by = 5e4), labels = paste(x/1000, "k", sep = "" ))