Removing top and right borders from boxplot frame in R

user3431483 picture user3431483 · Mar 18, 2014 · Viewed 19.6k times · Source

Does anyone know how to remove the top and right borders of the boxplot frame in R? I have tried the argument frame=FALSE but that removes all sides but the left side(y-axis). I just want the x-axis and y-axis to display.

Thanks in advance!

Answer

Chinmay Patil picture Chinmay Patil · Mar 18, 2014

I think you need to use axis(side=1) after plotting.

x <- 1:5
boxplot(x, frame.plot = FALSE)
axis(side = 1)

This gives

enter image description here