title: Colors for Categories in bar charts matplotlib
body: <p>I want to make my bar chart so that my colors match the categories, only that i'm slicing and groupingby my dataframe to reorganize it. Already achieved some results with some code. But my code is way too cranky i would like to know if there's some way to make it better.</p>
  
  <pre><code>pokecolor = {'Grass': '#78C850', 'Normal':'#A8A878','Fire':'#F08030','Fighting':'#C03028','Water':'#6890F0',           'Flying':'#A890F0','Poison':'#A040A0','Electric':'#F8D030','Ground':'#E0C068','Psychic':'#F85880','Rock':'#B8A038','Ice':'#98D8D8','Bug':'#A8B820','Dragon':'#7038F8','Ghost':'#705898','Dark':'#705848','Steel':'#B8B8D0','Fairy':'#EE99AC'}
  
  df_poke['Type 1 color'] = df_poke['Type 1'].map(lambda x: pokecolor[x])
  
  tipo1 = df_poke.loc[:,'Type 1'].value_counts(ascending=True)
  tipo1.plot(kind='barh', grid=True, figsize=(15,8),
            xticks= [n for n in range(0,111, 10)],
            color=tipo1.reset_index()['index'].apply(lambda x : pokecolor[x]))
  </code></pre>
  
  <p>I wanted to not have to make use of "tipo1", reset its index and apply pokecolor to it.</p>