如何避免在seaborn factorplot中显示没有任何相关数据的x轴标签

时间:2017-11-12 16:35:41

标签: python pandas seaborn

enter image description here

为了制作上面的情节,我这样做:

import seaborn as sns
g = sns.factorplot('State', ' % Overall Match', hue='experiment', data=df_states, col='percentile', kind='box', col_wrap=2, sharex=False)

有没有办法不显示没有相关数据的x轴标签?

- 编辑:数据可在此处获取:https://www.dropbox.com/s/pn7j95sjjb9n8t0/old_all.csv?dl=0

1 个答案:

答案 0 :(得分:1)

我想我会手动执行此操作:

fig, ax_array = plt.subplots(2,2)
axes = ax_array.flatten()

for ax, perc in zip(axes, df_states['percentile'].unique()):
     sns.boxplot('State', ' % Overall Match', hue='experiment',
                 data=df_states[df_states['percentile'] == perc], ax=ax)