Beeswarm with logarithmic X axis

304 Views Asked by At

I am trying to plot a "beeswarm" which is essentially a single-dimensional scatterplot

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

What I want to achieve is logarithmic transformation of the X axis.

Obviously, I can do beeswarm(log(breast$time_survival),horizontal=TRUE,method="hex") but it plots logarithmically transformed data and X axis no longer reperesents survival time numerically. Is there a way to directly affect the X axis? In regular scatterplot, I would do plot(breast$time_survival,log="x") but not sure how to behave with beeswarm

1

There are 1 best solutions below

2
On BEST ANSWER

option for beeswarm is log=TRUE, not log="x"

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

enter image description here