Seaborn Lineplot messes dates and data

by mitra mirshafiee   Last Updated August 01, 2020 10:19 AM - source

I'm trying to plot the values of a set of categories on a daily basis. The data is sorted based on the dates. But when I plot it with a seaborn line plot, it gets totally mixed up! (I added sort = False but didn't work)

Here is the code:

line1 = sns.lineplot(data = df_2,  x = 'date', y = 'cost', hue = 'category',
             sort = False, style="category", markers=True,  dashes=False)

line1.set_xticklabels(df_2.date, rotation=90);

messedup plot

It looks like the line plot is trying to sort the date values by itself and since my dates are like '%m-%d', it sorts the values first based on the days and then months!



Related Questions


Persistent Homology of High dimensional data

Updated November 15, 2018 17:19 PM