I have a pandas Series with two columns, Index (of timestamps) and floats
which I try to plot using Matplotlib as follows
s2.plot()
which gives me the following plot
now I want to format the x-axis to just show the timestamp in '%Y-%m-%d' format so I try
fig, ax = plt.subplots()
xdfmt = dates.DateFormatter('%Y-%m-%d')
ax.xaxis.set_major_formatter(xdfmt)
ax.xaxis_date()
s2.plot()
which fails as follows
dt = datetime.datetime.fromordinal(ix).replace(tzinfo=UTC)
ValueError: ordinal must be >= 1
How should I format the x-axis to display legible x-axis labels?