Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove default axis from the plot produced by boxplot()?

Tags:

r

boxplot

Probably this is a simple question,

Does anyone know how to hide the default axis x labels in boxplot() in R?

It should be simple, but I search on several sites and on boxplot help but could not find the answer.

like image 211
Francisco Avatar asked Jan 26 '13 13:01

Francisco


1 Answers

You mean like this?

 d <- data.frame(x = 2, y=1:5) 
 boxplot(d)
 boxplot(d, axes=FALSE) # add axes=FALSE to remove axes

you can then add axes however you please:

e.g.

 d <- data.frame(x = 2, y=1:5) 
 boxplot(d, axes=FALSE)
 axis(2, at=1:5, labels=c(rep("whatever I want",5)))

EDIT as per your comment:

remove default labels:

 boxplot(d, xaxt="n")
like image 168
user1317221_G Avatar answered Sep 21 '22 20:09

user1317221_G