<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/pandas-dev/pandas/blob/3a7f956c30528736beaae5784f509a76d892e229/pandas/plotting/_core.py#L2649-L2666">pandas/pandas/plotting/_core.py</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 2649 to 2666
      in
      <a data-pjax="true" class="commit-tease-sha" href="/pandas-dev/pandas/commit/3a7f956c30528736beaae5784f509a76d892e229">3a7f956</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L2649" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2649"></td>
          <td id="LC2649" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-k">def</span> <span class="pl-en">bar</span>(<span class="pl-s1">self</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-c1">None</span>, <span class="pl-c1">**</span><span class="pl-s1">kwds</span>): </td>
        </tr>

        <tr class="border-0">
          <td id="L2650" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2650"></td>
          <td id="LC2650" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">         <span class="pl-s">"""</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2651" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2651"></td>
          <td id="LC2651" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        Vertical bar plot</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2652" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2652"></td>
          <td id="LC2652" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"></span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2653" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2653"></td>
          <td id="LC2653" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        .. versionadded:: 0.17.0</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2654" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2654"></td>
          <td id="LC2654" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"></span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2655" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2655"></td>
          <td id="LC2655" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        Parameters</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2656" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2656"></td>
          <td id="LC2656" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        ----------</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2657" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2657"></td>
          <td id="LC2657" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        x, y : label or position, optional</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2658" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2658"></td>
          <td id="LC2658" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">            Coordinates for each point.</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2659" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2659"></td>
          <td id="LC2659" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        **kwds : optional</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2660" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2660"></td>
          <td id="LC2660" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">            Keyword arguments to pass on to :py:meth:`pandas.DataFrame.plot`.</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2661" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2661"></td>
          <td id="LC2661" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s"></span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2662" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2662"></td>
          <td id="LC2662" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        Returns</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2663" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2663"></td>
          <td id="LC2663" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        -------</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2664" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2664"></td>
          <td id="LC2664" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        axes : matplotlib.AxesSubplot or np.array of them</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2665" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2665"></td>
          <td id="LC2665" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-s">        """</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L2666" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="2666"></td>
          <td id="LC2666" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">         <span class="pl-k">return</span> <span class="pl-en">self</span>(<span class="pl-s1">kind</span><span class="pl-c1">=</span><span class="pl-s">'bar'</span>, <span class="pl-s1">x</span><span class="pl-c1">=</span><span class="pl-s1">x</span>, <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s1">y</span>, <span class="pl-c1">**</span><span class="pl-s1">kwds</span>) </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import pandas as pd
import numpy as np
import matplotlib
get_ipython().magic(u'pylab inline')

# In[17]:
df = pd.DataFrame({'id': range(1,11), 'normcolor': np.random.rand(10), 'count': np.random.randint(0,100,(10))})

# In[21]:
colors = matplotlib.cm.hsv(df['normcolor'])
df.plot.bar('id','count', color=colors) # return plot with not color variation


# In[22]:
plt.bar(df['id'], df['count'], color=colors) # returns plot as expected"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">pandas</span> <span class="pl-k">as</span> <span class="pl-s1">pd</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">import</span> <span class="pl-s1">matplotlib</span>
<span class="pl-en">get_ipython</span>().<span class="pl-en">magic</span>(<span class="pl-s">u'pylab inline'</span>)

<span class="pl-c"># In[17]:</span>
<span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">'id'</span>: <span class="pl-en">range</span>(<span class="pl-c1">1</span>,<span class="pl-c1">11</span>), <span class="pl-s">'normcolor'</span>: <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">rand</span>(<span class="pl-c1">10</span>), <span class="pl-s">'count'</span>: <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">0</span>,<span class="pl-c1">100</span>,(<span class="pl-c1">10</span>))})

<span class="pl-c"># In[21]:</span>
<span class="pl-s1">colors</span> <span class="pl-c1">=</span> <span class="pl-s1">matplotlib</span>.<span class="pl-s1">cm</span>.<span class="pl-en">hsv</span>(<span class="pl-s1">df</span>[<span class="pl-s">'normcolor'</span>])
<span class="pl-s1">df</span>.<span class="pl-s1">plot</span>.<span class="pl-en">bar</span>(<span class="pl-s">'id'</span>,<span class="pl-s">'count'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">colors</span>) <span class="pl-c"># return plot with not color variation</span>


<span class="pl-c"># In[22]:</span>
<span class="pl-s1">plt</span>.<span class="pl-en">bar</span>(<span class="pl-s1">df</span>[<span class="pl-s">'id'</span>], <span class="pl-s1">df</span>[<span class="pl-s">'count'</span>], <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">colors</span>) <span class="pl-c"># returns plot as expected</span></pre></div>
<h1 dir="auto">Current Output</h1>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6607313/29251984-dabee23e-807c-11e7-80a3-bd3d57cfefba.png"><img src="https://user-images.githubusercontent.com/6607313/29251984-dabee23e-807c-11e7-80a3-bd3d57cfefba.png" alt="image" style="max-width: 100%;"></a></p>
<h1 dir="auto">Correct Output</h1>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6607313/29251985-e421e4e8-807c-11e7-9fb0-f68da61a8089.png"><img src="https://user-images.githubusercontent.com/6607313/29251985-e421e4e8-807c-11e7-9fb0-f68da61a8089.png" alt="image" style="max-width: 100%;"></a></p>
<h4 dir="auto">Code Sample, a copy-pastable example if possible</h4>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt;&gt;&gt; df = pd.DataFrame({&quot;A&quot;: range(4), &quot;color&quot;: ['red', 'blue', 'blue', 'red']})
&gt;&gt;&gt; ax = df.plot.bar(y='A', color=df['color'])
&gt;&gt;&gt; [p.get_facecolor() for p in ax.patches]
[(1.0, 0.0, 0.0, 1.0),
 (1.0, 0.0, 0.0, 1.0),
 (1.0, 0.0, 0.0, 1.0),
 (1.0, 0.0, 0.0, 1.0)]"><pre class="notranslate"><span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">df</span> <span class="pl-c1">=</span> <span class="pl-s1">pd</span>.<span class="pl-v">DataFrame</span>({<span class="pl-s">"A"</span>: <span class="pl-en">range</span>(<span class="pl-c1">4</span>), <span class="pl-s">"color"</span>: [<span class="pl-s">'red'</span>, <span class="pl-s">'blue'</span>, <span class="pl-s">'blue'</span>, <span class="pl-s">'red'</span>]})
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> <span class="pl-s1">ax</span> <span class="pl-c1">=</span> <span class="pl-s1">df</span>.<span class="pl-s1">plot</span>.<span class="pl-en">bar</span>(<span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-s">'A'</span>, <span class="pl-s1">color</span><span class="pl-c1">=</span><span class="pl-s1">df</span>[<span class="pl-s">'color'</span>])
<span class="pl-c1">&gt;&gt;</span><span class="pl-c1">&gt;</span> [<span class="pl-s1">p</span>.<span class="pl-en">get_facecolor</span>() <span class="pl-k">for</span> <span class="pl-s1">p</span> <span class="pl-c1">in</span> <span class="pl-s1">ax</span>.<span class="pl-s1">patches</span>]
[(<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>),
 (<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>),
 (<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>),
 (<span class="pl-c1">1.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">0.0</span>, <span class="pl-c1">1.0</span>)]</pre></div>
<h4 dir="auto">Problem description</h4>
<p dir="auto">It plots correctly but it does not pick the right color per bar. it only pick the color of the first value in the list.<br>
it was working perfectly in pandas 0.19.2</p>
<h4 dir="auto">Expected Output</h4>
<p dir="auto">the plot should contain a different color as the list is being passed. Similar to matplotlib behavior and the old pandas version</p>
<h4 dir="auto">Output of <code class="notranslate">pd.show_versions()</code></h4>
<details> 
<p dir="auto">pandas: 0.20.2<br>
pytest: None<br>
pip: 9.0.1<br>
setuptools: 36.0.1<br>
Cython: None<br>
numpy: 1.12.1<br>
scipy: 0.19.1<br>
xarray: None<br>
IPython: 5.4.1<br>
sphinx: None<br>
patsy: None<br>
dateutil: 2.6.0<br>
pytz: 2017.2<br>
blosc: None<br>
bottleneck: None<br>
tables: None<br>
numexpr: None<br>
feather: None<br>
matplotlib: 2.0.2<br>
openpyxl: None<br>
xlrd: 1.0.0<br>
xlwt: None<br>
xlsxwriter: None<br>
lxml: None<br>
bs4: None<br>
html5lib: 0.9999999<br>
sqlalchemy: None<br>
pymysql: None<br>
psycopg2: 2.7.1 (dt dec pq3 ext lo64)<br>
jinja2: 2.9.6<br>
s3fs: None<br>
pandas_gbq: None<br>
pandas_datareader: None</p>
</details>