Removing axes in beeswarm plot

311 Views Asked by At

I have a following "beeswarm" (a single-dimensional scatterplot)

library(beeswarm)
data(breast)
beeswarm(breast$time_survival,horizontal=TRUE)

Here is the resulting plot:

enter image description here

How can I get rid of the axes and the box around the plot, so that I can reintroduce only the X axis and nothing else around it?

2

There are 2 best solutions below

0
On BEST ANSWER

If you create an empty plot first

plot(rnorm(10), type="n", axes=FALSE, xlim=c(0, 200), ylim=c(0.4, 1.6), 
     xlab="", ylab="")

Then you can use the add argument to get what you want

beeswarm(breast$time_survival,horizontal=TRUE, add=TRUE)
0
On

You can use the "axes" argument (described in ?plot.default).

beeswarm(breast$time_survival, horizontal=TRUE, axes = FALSE)