Two subplots of gridspec, one line plot and the other bar plot, with a time-series on x, are not displaying
<p>I can't figure out what I'm doing wrong in my plotting.
Plotting some data vs datetime on two subplots, one is a line plot, the other one should be a bar plot. I have tried several different ways of plotting it but without much success. </p>

<p><strong>UPDATE</strong>
 Minor progress - the first plot is displayed, the second one not.</p>

<p>Data looks for example like this:</p>

<pre><code>                    A  B    C
0 2014-10-23 15:44:00  1  1.5
1 2014-10-30 19:10:00  2  2.0
2 2014-11-05 21:30:00  3  3.3
3 2014-11-07 05:50:00  4  4.0
4 2014-11-12 12:20:00  5  5.8
</code></pre>

<p>The latest version of the code:</p>

<pre><code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
import datetime

Test = pd.DataFrame({'A':[datetime.datetime(2014,10,23,15,44),datetime.datetime(2014,10,30,19,10),
datetime.datetime(2014,11,5,21,30),datetime.datetime(2014,11,7,5,50), 
datetime.datetime(2014,11,12,12,20)],'B':[1,2,3,4,5],'C':[1.5,2,3.3,4,5.8]})

fig = plt.figure(figsize=(8,8))

gs=gridspec.GridSpec(2,1, hspace=0.1, wspace=0.3, height_ratios=[1,1])

axes1 = plt.subplot(gs[0,0])
ax1 = plt.plot(Test["A"],Test["B"], 'dimgrey', linewidth = 2.5, label = "test")
#DepTime = DepTime.set_index("DATETIME")
#for l in log_times:
#    ax1 = plt.bar(l,DepTime.ix[l,"Depth"], width = 1.5, color='b')
ax1 = plt.xlim(Test.iloc[0,0],Test.iloc[-1,0])
xticks2 = pd.date_range(start=Test.iloc[0,0],end=Test.iloc[-1,0], freq='D', normalize=True) 
ax1 = plt.xticks(xticks2,xticks2)
ax1 = plt.setp(axes1.get_xticklabels(), visible=False)
ax1 = plt.ylim(1,5)
ax1 = plt.yticks(np.arange(0,5,1),rotation=0)
ax1 = plt.ylabel("B",fontsize = 12)

axes2 = plt.subplot(gs[1,0])
ax2 = Test.plot("A","C",kind='bar', ax=axes2) #
#ax2 = plt.bar(Test["A"],Test["C"],color='k')
#ax2 = plt.xlim(Test.iloc[0,0],Test.iloc[-1,0])
ax2 = plt.xlim(Test.iloc[0,0],Test.iloc[-1,0])
ax2 = plt.xlabel("A",fontsize=12)
#ax2 = plt.xaxis_date()
#ax2.xaxis.set_major_formatter(mdates.DateFormatter('%d))
ax2 = plt.xticks(xticks2,xticks2, rotation=45)
#axes2.xticklabels([x.strftime('%d/%m/%Y %H:%M') for x in xticks2])
#ax2.autofmt_xdate()
#ax2 = plt.yticks([0,1])
ax2 = plt.ylim(1,5)
ax2 = plt.setp(axes2.get_yticklabels(), visible=False)
fig = plt.show()
</code></pre>

<p>And the resulting figure:
<a href="http://i.stack.imgur.com/iPokE.png" rel="nofollow"><img src="http://i.stack.imgur.com/iPokE.png" alt="The incomplete plot"></a></p>

<p>I found out what the problem was!!! I don't understand why it worked fine with the line plot and not with the bar plot, but all that needed to be changed in the code is the actual one line for the bar plot. It should go like this:</p>

<pre><code>ax2 = plt.bar(Test["A"].values,Test["C"],width=1)
</code></pre>

<p>So bar plot can't handle datetime?
(This <a href="http://stackoverflow.com/a/25234067/5553319">answer</a> helped)</p>

python python-2.7 pandas matplotlib bar-chart