I am trying to get a dataframe column to display the date as example "Jan 15, Feb 15 etc" on a chart. But it was displaying as "Feb 115, Mar 115 etc" I have tried to adapt some code using matplotlib.ticker. but then the chart comes out with no axis. Here is a simplified version of the code, not working.
import matplotlib.pyplot as plt
import matplotlib.ticker as tkr
# create figure instance
fig1 = plt.figure(1)
ax = fig1.add_subplot(2,1,1)
x = 41640, 41671, 41699, 41730, 41760, 41791
y = 1, 4, 7, 9, 15, 18
ax.get_xaxis().set_major_formatter(
tkr.FuncFormatter(lambda x, p: format((x), '%b %y')))
ax.plot_date(x, y)
fig1.show()