title: Combine Bar and Line subplots in pandas
body: <p>I have 5 time series that I want to graph in a subplot. Essentially I've been using subplotting:</p>
  
  <pre><code>fig, axes = plt.subplots(nrows=5, ncols=1, figsize=(16,10), sharex=True)
  xlim = (start, end)
  ax1=df.hr.plot(ax=axes[0], color='green', xlim=xlim)
  ax2=df.act.plot(ax=axes[1], color='orange', xlim=xlim)
  ax3=df.rr.plot(ax=axes[2], color='blue', xlim=xlim)
  ax4=df2.set_index('timestamp').rmssd.plot(color='purple', ax=axes[3], xlim=xlim)
  ax5=ma_df.tz_convert('US/Eastern')['any_act'].resample('10Min', how='count').plot(kind='line',ax=axes[4])
  </code></pre>
  
  <p>Which produces</p>
  
  <p><a href="https://i.stack.imgur.com/xpZIW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xpZIW.png" alt="enter image description here"></a></p>
  
  <p>Due to the nature of the data, I want to visualize the last subplot as bar chart. So naturally, I changed the last line to:</p>
  
  <pre><code>ax5=ma_df.tz_convert('US/Eastern')['any_act'].resample('10Min', how='count').plot(kind='bar',ax=axes[4])
  </code></pre>
  
  <p>Which then creates the following figure:</p>
  
  <p><a href="https://i.stack.imgur.com/qns8e.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qns8e.png" alt="enter image description here"></a></p>
  
  <p>Which, produces what I expect in the last subplot, but makes the other plots useless. Needless to say, it's not what I want.</p>
  
  <p>How can I combine the 4 line time series with one bar chart in the same plot, but different subplots, all sharing the same x-axis?
  Meaning I would want the first 4 subplotplots like in the first image, and the last subplot like in the second image. </p>
  
  <p><strong>Update</strong></p>
  
  <p>I made a simple example, which unfortunately works as expected, and does not replicate my problem, which is even more baffling. Code is below</p>
  
  <pre><code>import pandas as pd
  from matplotlib import pyplot as plt
  %matplotlib inline
  df =  pd.read_csv('https://s3.amazonaws.com/temp-leonsas-qsaeamu0sl5v4b/df.csv')
  bar_df = pd.read_csv('https://s3.amazonaws.com/temp-leonsas-qsaeamu0sl5v4b/bar_df.csv')
  fig, axes = plt.subplots(nrows=4, ncols=1, figsize=(16,10), sharex=True)
  ax1=df.hr.plot(ax=axes[0], color='green', kind='line')
  ax2=df.act.plot(ax=axes[1], color='orange', kind='line')
  ax3=df.rr.plot(ax=axes[2], color='blue', kind='line')
  ax4=bar_df.occ_count.plot(ax=axes[3], kind='bar')
  </code></pre>
  
  <p>Whereas the code in my codebase which replicates the problem is</p>
  
  <pre><code>fig, axes = plt.subplots(nrows=4, ncols=1, figsize=(16,10), sharex=True)
  ax1=df.hr.plot(ax=axes[0], color='green', kind='line')
  ax2=df.act.plot(ax=axes[1], color='orange', kind='line')
  ax3=df.rr.plot(ax=axes[2], color='blue', kind='line')
  ax4=bar_df.occ_count.plot(ax=axes[3], kind='bar')
  </code></pre>
  
  <p>The main difference is that in my codebase the DataFrames are being generated and not just loaded up from s3. Is there an implicit config inside a DataFrame that can somehow make this happen? I just used <code>df.to_csv</code> to dump those 2 dataframes into S3.</p>