ax.xaxis.set_major_locator(dates.MinuteLocator())
ax.xaxis.set_major_formatter(hfmt)
ax.set_ylim(bottom=0)
plt.xticks(rotation='vertical')
plt.subplots_adjust(bottom=0.3)
plt.show()
Creating graph with date and time in axis labels with matplotlib