[R] Removing axes / frame from plot()

Alex Park
2007-11-11T16:49:34Z

R Help

Feel sure there is a simple answer to this but answer has eluded me so far.

NB. Using R 2.6.0.

I am plotting a simple chart using plot():

plot(df, ylim=c(as.numeric(min(df)), as.numeric(max(df))),
col="OliveDrab",
xlab="", ylab="")

What I would like to do is have this chart appear such that there is only an
x and a y axis. I do not want a frame around my plot.

First I tried:

axis(side=2, xact="n"); axis(side=3, yact="n")

but this didn't work.

Then I looked up:

?plot.default

In here there is an argument called 'frame.plot' which is described as
"a
logical indicating whether a box should be drawn around the plot."

I tried:

plot(df, ylim=c(as.numeric(min(df)), as.numeric(max(df))),
col="OliveDrab",xlab="", ylab="",
frame.plot=FALSE)

but got an error message:

"plot.frame" is not a graphical parameter

Also, I looked up:

?par

But it seems there is no parameter in here to control plot.frame.

Any ideas on this as I seem to have exhausted my options.

Thanks


Alex