I have resampled data from a monthly series to plot the yearly mean value. However, the year ticks show up in the following format in the X axis:
However, I want only the years to be shown, not the entire timestamp. But the following code does not plot the graph correctly.
ax = umtmvsDF.resample('A').mean().plot.bar(title='Average value per year',grid=True,color=(.21,.42,.12),figsize=(12,10))
ax.set(xlabel=Constants.TIME,ylabel=Constants.USD)
ax.xaxis.set_major_formatter(dates.DateFormatter('%Y'))
plt.show()
This code shows all the ticks to be equal to 1970. What am I doing wrong here?