Is there any way to use non-uniform spacing on a discrete axis in seaborn's swarmplots?
Here's an example:
import pandas as pd
import numpy as np
import seaborn as sns
data = pd.DataFrame({
"x":np.concatenate([np.repeat("A",450), np.repeat("B",5), np.repeat("C",5), np.repeat("D",450)]),
"y":np.random.randn(910)})
sns.swarmplot(x="x",y="y",data=data)
In the example the A and D categories overflow the plot. I could reduce the point size, but then the middle categories become hard to see. A better option would be to set the axis spacing such that the frequent categories have more space than the rare categories:
Is there any way to do this with seaborn (or the underlying matplotlib axes)?