Desktop Survival Guide
by Graham Williams

Controlling Axes

You can build up various features of a plot bit by bit. For example, you can specify how much of a box to add around the plot with the box function. In fact, you can use any of the following box line options to draw different extents of the box. The sides are number from 1 for the lower side, then clockwise.

"o" gives you all four sides (1:4)
"l" gives you left and lower (2 and 1)
"7" gives you upper and right (3:4)
"c" gives you all except right (1:2, 3)
"u" gives you all except upper (1:2, 4)
"]" gives you all except left (1, 3:4)

The plot function here requests that the axes not be drawn, and the chosen box is then drawn on top of the current plot.

Image rplot-iris-topbox

plot(Petal.Length, Petal.Width, axes=FALSE)

Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010