title: Pandas plot bar chart over line
body: <p>I'm trying to plot a bar and a line on the same graph. Here is what works and what does not work. Would anyone please explain why? </p>
  
  <p>What does NOT work: </p>
  
  <pre><code>df = pd.DataFrame({'year':[2001,2002,2003,2004,2005], 'value':[100,200,300,400,500]})
  df['value1']= df['value']*0.4
  df['value2'] = df['value']*0.6
  fig, ax = plt.subplots(figsize = (15,8))
  df.plot(x = ['year'], y = ['value'], kind = 'line', ax = ax)
  df.plot(x = ['year'], y= ['value1','value2'], kind = 'bar', ax = ax)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/aQJrF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aQJrF.png" alt="enter image description here"></a></p>
  
  <p>But somehow it works when I delete the <code>x=['year']</code> in the first plot:</p>
  
  <pre><code>fig, ax = plt.subplots(figsize = (15,8))
  df.plot(y = ['value'], kind = 'line', ax = ax)
  df.plot(x = ['year'], y= ['value1','value2'], kind = 'bar', ax = ax)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/th5qx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/th5qx.png" alt="enter image description here"></a></p>