pandas bar plot not displaying what I need
<p>I have this pandas DataFrame:</p>

<pre><code>   data = {'state': ['Ohio', 'Ohio', 'Ohio', 'Nevada', 'Nevada'],
                 'year': [2000, 2001, 2002, 2001, 2002],
                 'pop': [1.5, 1.7, 2.1, 1.4, 2.9]}
    df = pd.DataFrame(data)
</code></pre>

<p>I would like to get something like this inside a Python notebook:
<a href="https://i.stack.imgur.com/irHwh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/irHwh.png" alt="enter image description here"></a></p>

<p>Here is what I tried:</p>

<pre><code>import matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

q = p.set_index(['state'])
q['pop'].plot(kind='bar')
</code></pre>

<p>which gives this:
<a href="https://i.stack.imgur.com/F0QXF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F0QXF.png" alt="enter image description here"></a></p>

<p>What am I missing ?</p>