Open sunroofgod opened 10 months ago
I think this poses some tricky API issues.
1) Several of the categorical functions produce asymmetrical plots that might make sense to draw "half" of this way. Would adding this just to swarmplot introduce new API inconsistencies?
2) While you mention that violinplot has a similar feature, it's not identical: a single split violin (as of v0.13.0 where this became possible) spans the entire width of the space allotted for a non-split violin. Maybe that is actually not ideal and it would be better for odd splits to occupy half the space, but that does mean that just adding split
to swarmplot to make the plot you're showing above doesn't make much sense.
3) What happens with hue
is used? Would you have multiple colors on swarms with the shapes your'e showing above? People would probably want, if not expect, that the swarm might "split" the way the violin plot does (they certainly would if the split
parameter is used).
Hi, thank you so much for the reply! Will look into the concerns you've brought up and get back to you again once we have something more substantial.
Hi!
I wanted to check how open the seaborn team would be to adding an additional param to the
swarmplot()
function to plot asymmetric swarmplots as well.For example, users could potentially call
side
: "r" | "l" | "c", which represents the sides "right", "left", "center" respectively that the swarm plot would be aligned against. ("center" would be the same as how the swarmplots are currently being plotted)tips = sns.load_dataset("tips") sns.swarmplot(data=tips, x="day", y="total_bill", hue="day", legend=False, side="right")
Both of which would result in the following plot below:
(The plot above has been produced via code edits I've made to the current
swarmplot()
function wrt point 1.)To sum it up,
Thank you so much!