Solved! Thanks to @hpaulj for the pointer. I was wrongly assuming that scat.set_offsets()
needed datetime input for a plot with dates, so was resistant to passing floats. It turns out, however, that a date scatter plot can accept floats passed to set_offsets
and still display the data correctly.
I've converted the column in question via the following:
df.loc[:, 'date'] = df['date'].map(lambda x: matplotlib.dates.date2num(x))
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…