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.
UPDATE Minor progress - the first plot is displayed, the second one not.
Data looks for example like this:
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
The latest version of the 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()