Oposum Oposum -4 years ago 141
R Question

Beeswarm with logarithmic X axis

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

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download