I have a pandas dataframe that uses strings as index. How can I set xlim for the x axis when my dataframe index is of type object? I tried adding two additional years one at the end and one at the beginning where all datasets are np.nan but that didn't work.
Here is the dataframe
The datatype of index is object
df.index
Out[52]: Index(['2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012'], dtype='object')
Here is the plot
So I would like to have some extra space on the x-axis in so the values for the fist and last year are better visible. What could I do?
EDIT:
Here is a minimal example using objects and not date objects as index