python's ggplot does not use year number as label on axis
Question: In the following MWE, my `year` variable is shown on the x-axis as 0 to 6
instead of the actual year number. Why is this?

    
    
    import pandas as pd
    from pandas_datareader import wb
    from ggplot import *
    
    dat = wb.download(
        indicator=['BX.KLT.DINV.CD.WD', 'BX.KLT.DINV.WD.GD.ZS'],
        country='CN', start=2005, end=2011)
    dat.reset_index(inplace=True)
    
    print ggplot(aes(x='year', y='BX.KLT.DINV.CD.WD'),
           data=dat) + \
        geom_line() + theme_bw()
    


Answer: All you need to do is convert the `year` column from an `object` `dtype` to
`datetime64`:

    
    
    dat['year'] = pd.to_datetime(dat['year'])
    

[![enter image description
here](http://i.stack.imgur.com/3fHgf.png)](http://i.stack.imgur.com/3fHgf.png)

