Skip to content
Advertisement

Seaborn expands X axis dates back to year 2000

I have a pandas dataframe that contains dates starting at 2017-09-01 (which I believe is in the correct format for a dataframe date). But the X axis is expanded dramatically. I do not have any outliers on the LHS.

enter image description here

JavaScript

enter image description here

Advertisement

Answer

Pandas and matplotlib’s dates sometimes don’t go along well. You can set the xlims explicitly as follows:

JavaScript

resulting plot

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement