eclarke / ggbeeswarm

Column scatter / beeswarm-style plots in ggplot2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request - alternative stacking directions

tjebo opened this issue · comments

commented

See This related stackoverflow thread
geom_dotplot does not allow for the plot as shown by SO user jimbou. (The plot was created by Hadley). The nice thing about this plot are the gaps between the "bins". This can only be achieved with some fanciful data preparation and geom_point.
I think geom_beeswarm does already something very similar - but the stacking of the point is currently all centered. It would be great if one could also chose an alternative stacking direction, such as you can in geom_dotplot(..., stackdir = "up"/ "down"/"center"/ "centerwhole"')

Thanks for the suggestion tjebo. The beeswarm package we're wrapping already has that functionality so I added a beeswarmArgs argument to geom_beeswarm to allow additional arguments to pass to the underlying swarmx function of beeswarm. You should be able to test it out from the github version of the package.

For example:

ggplot2::qplot(class, hwy, data = ggplot2::mpg, geom='beeswarm',beeswarmArgs=list(side=1))

oneSided

commented

Awesome! Thanks also for the swift response :)

This doesn't seem to work anymore.

Ah, apologies! I see that this is deprecated, but the GitHub version has method="center" and side=0!