I'm trying to remove one xticks
(one column on a categorical axis) from a Seaborn FacetGrid plot. I'm not sure either how to keep the spacing between each tick similar between subplots.
A picture is worth a thousand words, see pictures below:
# Testing code
df = pd.DataFrame()
df['Value'] = np.random.rand(100)
df['Cat1'] = np.random.choice(['yes', 'no', 'maybe'], 100)
df['Cat2'] = np.random.choice(['Blue', 'Red'], 100)
df = df[~((df.Cat1 == 'maybe') & (df.Cat2 == 'Red'))]
g = sns.catplot(
data=df,
x='Cat1',
y='Value',
col='Cat2',
col_order=['Red', 'Blue'],
order=['yes', 'no', 'maybe'],
sharex=False,
color='black')
If we don't set the order, it creates a plot like this:
which has two issues: the order is not set (we want that), and the spacing is awkward.
Any tips? Thanks!