title: pandas color scheme not working properly with my data (python)
body: <p>I would like to change the default color scheme of my pandas plot. I tried with different color schemes through <code>cmap</code> pandas parameter, but when I change it, all bars of my barplot get the same color.</p>
  
  <p>The code I tried is the following one:</p>
  
  <pre><code>yearlySalesGenre = df1.groupby('Genre').Global_Sales.sum().sort_values()
  fig = plt.figure()
  ax2 = plt.subplot()
  yearlySalesGenre.plot(kind='bar',ax=ax2, sort_columns=True, cmap='tab20')
  plt.show(fig)
  </code></pre>
  
  <p>And the data that I plot (<code>yearlySalesGenre</code>) is a pandas Series type:</p>
  
  <pre><code>Genre
  Strategy         174.50
  Adventure        237.69
  Puzzle           243.02
  Simulation       390.42
  Fighting         447.48
  Racing           728.90
  Misc             803.18
  Platform         828.08
  Role-Playing     934.40
  Shooter         1052.94
  Sports          1249.47
  Action          1745.27
  </code></pre>
  
  <p>Using <code>tab20</code> cmap I get the following plot:</p>
  
  <p><img src="https://i.imgur.com/9r0UiZr.png" alt="plot with cmap tab20"></p>
  
  <p>I get all bars with the first color of all the tab20 scheme. What I am doing wrong?</p>
  
  <p>Note that if I use the default color scheme of pandas plot, it properly displays all bars with different colors, but the thing is that I want to use a particular color scheme.</p>
  
  <hr>
  
  <p>As posted, it's a duplicated answer. Just in case, the answer is that pandas makes color schemes based on different columns, not in rows. So to use different colors you can transpose the data + some other stuff (duplicated link), or directly use the matplotlib.pyplot plotting that allows more flexibility (in my case):</p>
  
  <pre><code>plt.bar(range(len(df)), df, color=plt.cm.tab20(np.arange(len(df))))
  </code></pre>