When plotting a Series with a PeriodIndex, pandas always locates the xlabels on the beginning of a Period:
DATA = pd.Series(np.random.randn(120), index=pd.period_range("2013-01", "2012-12", freq="M"))
DATA.plot(ax=plt.gca())
So in this case, the annual labels (2003, ... 2012) are located at the first of January of each year. How can I have the annual labels centered horintally, while keeping the xticks at their places?
So in my example, I want the major_xticks located on each Jan 1st, but the label "2012" be centered between 2012-01-01 and 2013-01-01.