Search code examples
rscatter-plotbeeswarm

Removing axes in beeswarm plot


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?


Solution

  • 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)