1

enter image description here

To make the plot above, I do this:

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

Is there a way to NOT display the x-axis labels that do not have nay associated data?

-- EDIT: Data is available here: https://www.dropbox.com/s/pn7j95sjjb9n8t0/old_all.csv?dl=0

user308827
  • 21,227
  • 87
  • 254
  • 417
  • Do you want to empty the space taken by the data not being there, or do you want to remove the ticklabels at those positions that do not have any data associated? Also note that you would increase your chances of obtaining a satisfying answer dramatically by supplying a [mcve] with some that can be used to show a possible solution. – ImportanceOfBeingErnest Nov 12 '17 at 18:51
  • thanks @ImportanceOfBeingErnest, I want to remove the ticklabels at those positions that do not have any data associated with them – user308827 Nov 12 '17 at 22:14
  • @ImportanceOfBeingErnest, data is here: https://www.dropbox.com/s/pn7j95sjjb9n8t0/old_all.csv?dl=0 – user308827 Nov 13 '17 at 00:54
  • This might be a good start: [How to make good reproducible pandas examples](https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples). – ImportanceOfBeingErnest Nov 13 '17 at 07:39

1 Answers1

1

I think I would do this manually:

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)
Ted Petrou
  • 59,042
  • 19
  • 131
  • 136