import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import datetime as dt
x = mpl.dates.drange(dt.datetime(2009, 10, 1), dt.datetime(2010, 1, 15), dt
    .timedelta(days=1))
x += np.random.random(x.size)
times = x % 1 + int(x[0])
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot_date(x, times, 'ro')
ax.yaxis_date()
fig.autofmt_xdate()
plt.show()
plot time of day vs date in matplotlib