title: Remove empty bars from grouped barplot
body: <p>I have a grouped barplot. It's working very well, but I try to remove the empty barplots. They take too much space.</p>
  
  <p>I have already tried :</p>
  
  <pre><code>%matplotlib inline
  import matplotlib as mpl
  from matplotlib.gridspec import GridSpec
  import matplotlib.pyplot as plt
  import sys
  import os
  import glob
  import seaborn as sns
  import pandas as pd
  import ggplot
  from ggplot import aes
  
  sns.set(style= "whitegrid", palette="pastel", color_codes=True )
  
  tab_folder = 'myData'
  out_folder ='myData/plots'
  tab = glob.glob('%s/R*.tab'%(tab_folder))
  
  #is reading all my data
  for i, tab_file in enumerate(tab):
      folder,file_name=os.path.split(tab_file)
      s_id=file_name[:-4].replace('DD','')
      df=pd.DataFrame.from_csv(tab_file, sep='\t')
  
      df_2 = df.groupby(['name','ab']).size().reset_index(name='count')
  
      df_2 = df_2[df_2['count'] != 0]
  
      table = pd.pivot_table(df_2, index='name',columns='ab', values='count' ) 
      table.plot(kind='barh', width = 0.9, color = ['b', 'g', 'r'], ax = ax)
  
      for label in (ax.get_xticklabels() + ax.get_yticklabels()):
  
          label.set_fontsize(4)
  
  
      ax.set_title(s_id).update({'color':'black', 'size':5, 'family':'monospace'})
      ax.set_xlabel('')
      ax.set_ylabel('')
  
      handles, labels = ax.get_legend_handles_labels()
      ax.legend(handles[::-1], labels[::-1], bbox_to_anchor=(1, 1.05),prop= {'size': 4} )
  
  png_t = '%s/%s.b.png'%(out_folder,s_id)
  plt.savefig(png_t, dpi = 500)
  </code></pre>
  
  <p>But it's not working. The bars are still the same.
  Is there any other method to remove empty bars? </p>