Improved beeswarm layout based on ggdist talk discussion Wed #110
Replies: 3 comments 1 reply
-
|
Hi @mjskay, Wow, this is fantastic—thanks so much for taking it on! Best, |
Beta Was this translation helpful? Give feedback.
-
|
Wow, that's fantastic. Thank you for taking on this problem. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @mjskay, I still really love your solution to the swarm asymmetry problem. While trying out the most recent ggdist version, I noticed that it doesn’t seem to have made it into the released version yet—am I right? Did you run into any issues with the implementation, or is it more a matter of time and priorities? I’d absolutely love to be able to use your solution in my plots someday. Best, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@jbengler asked a good question at the {ggdist} talk on Wed: is there a nice-looking beeswarm layout algorithm that doesn't end up with visual asymmetry in small groups? I didn't have an answer at the time, but it occurred to me today that a minor modification to the "swarm" layout in {ggdist} (which uses the "compact swarm" layout from {beeswarm}) might do the trick.
Here is the normal swarm layout as I was demoing on Wed:
Notice that in small clusters it can be visually asymmetrical. If we re-center contiguous clusters on their mean y position, most of the asymmetry disappears (code same as above, using a ggdist branch):
If you open the images in two separate tabs and flip back and forth you can see what's happening more easily. This is a simple change that I think results in a strictly better layout. It also breaks up the continuous center line of the swarms a bit, which IMO is good --- I've never been a big fan of that visual artifact. I will likely (after some additional testing) just replace the "swarm" layout in {ggdist} with this.
Beta Was this translation helpful? Give feedback.
All reactions