como plotar o tempo no eixo y no formato '% H:% M' no matplotlib?

eu gostaria de plotar os horários de uma série datetime64, onde o eixo y é formatado como '% H:% M, mostrando apenas 00:00, 01:00, 02:00, etc.

é assim que o gráfico se parece sem personalizar a formatação do eixo y.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.dates import DateFormatter
from matplotlib.dates import HourLocator

df = pd.DataFrame(data=dict(a=pd.date_range('1/1/2011',periods=1440000,freq='1min')))
df = df.iloc[np.arange(0,1440*100,1440)+np.random.randint(1,300,100)]

plt.plot(df.index,df['a'].dt.time)
plt.show()

Depois de ler o tópico sobre SO, tentei o seguinte, mas sem sucesso.

ax = plt.subplot()
ax.yaxis.set_major_locator(HourLocator())
ax.yaxis.set_major_formatter(DateFormatter('%H:%M'))
plt.plot(df.index,df['a'].dt.time)
plt.show()

ValueError: DateFormatter found a value of x=0, which is an illegal date.  This usually occurs because you have not informed the axis that it is plotting dates, e.g., with ax.xaxis_date()

Alguém poderia me aconselhar?

questionAnswers(2)

yourAnswerToTheQuestion