Removing top and right borders from boxplot frame in R
To remove ticks, you need to specify the ticks line width as zero (lwd.ticks=0). To ensure the x and y axes meet is a bit more laborious, you need to
- specify the lower limit of the y axis using ylim=...
- specify the height of the x axis using pos=...
- extend the x axis to the y axis - one way is simply to add a horizontal line using abline.
Putting that all together for the example above:
x <- 1:5boxplot(x, frame.plot = FALSE,ylim=c(0,5))axis(side=1, pos=0, lwd.ticks=0)abline(h=0)