Removing a frame from the Boxplot () function in R

Does anyone know how to remove a frame when creating a boxplot using the R boxplot() function?

Using the plot() function, there is an optional argument frame=F that does the job ... but it is not included in the boxplot() function ...

Many thanks!

+7
source share
4 answers

Use the frame=F (or frame.plot=F ) function in the boxplot function:

 boxplot(count ~ spray, data = InsectSprays, col = "lightgray",frame=F) 

Other parameters that can be used in the boxplot function (rather inconvenient) are listed on the ?bxp man page, which is the main function of boxplot()

+13
source

You can do this with bty in par . Using the example from boxplot help:

 par(bty='n') boxplot(count ~ spray, data = InsectSprays, col = "lightgray") 
+5
source

boxplot() seems like the frame argument is just good.

  boxplot(count ~ spray, data = InsectSprays, col = "lightgray") #vs boxplot(count ~ spray, data = InsectSprays, col = "lightgray", frame = FALSE) 
+4
source

Here is the simplest solution. Just set axis = 0

 boxplot(runif(100), axes = 0) 
0
source

All Articles