Removing the frame from the Boxplot() function in R
Does someon开发者_高级运维e know how to remove the frame when producing a boxplot with the R boxplot()
function?
With the plot()
function there is an optinal argument, frame=F
, that does the job... but it is not included in the boxplot()
function...
Thank you very much!
Use the option frame=F
(or frame.plot=F
) in the boxplot function :
boxplot(count ~ spray, data = InsectSprays, col = "lightgray",frame=F)
Other parameters that can be used in the boxplot function are (rather inconveniently) listed on the helppage of ?bxp
, which is the underlying function of boxplot()
You can do this with bty
in par
. Using an example from the boxplot
help:
par(bty='n')
boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
boxplot()
seems to accept the frame
argument just fine.
boxplot(count ~ spray, data = InsectSprays, col = "lightgray")
#vs
boxplot(count ~ spray, data = InsectSprays, col = "lightgray", frame = FALSE)
Here is the easiest solution. Just set axes = 0
boxplot(runif(100), axes = 0)
精彩评论