I am trying to plot a lineplot in seaborn with values for the y axis and dates for the x axis coming from a pandas dataframe.
When I create the lineplot without converting the date column to datetime object it puts the dates in the wrong order. When I do convert the date column to datetime format it gives strange x labels and only shows 5 of the dates.
df = pd.read_csv("dddd.csv")
df["date"] = pd.to_datetime(df["date"])
df = df.sort_values(["date"])
ax = sns.lineplot(y=df["google"],x=df["date"],color="red",data=df)
plt.show()
I want to just plot the data with the x labels being the dates have it in order. Here is some example data.
25-03-2019 -100
26-03-2019 -66.66666667
27-03-2019 -80
28-03-2019 -87.08333333
29-03-2019 -88.88888889
30-03-2019 -86.28526646
31-03-2019 -87.5
01-04-2019 -87.87878788
02-04-2019 -82.92682927
03-04-2019 -84.09090909
04-04-2019 -84.7826087
05-04-2019 -85.71428571
06-04-2019 -81.30677848
07-04-2019 -81.98051948
08-04-2019 -82.14285714
09-04-2019 -78.46153846
10-04-2019 -76.05633803
11-04-2019 -75
12-04-2019 -75
13-04-2019 -80
14-04-2019 -83.33333333
15-04-2019 -83.33333333
16-04-2019 -77.77777778
17-04-2019 -68
18-04-2019 -54.70085471
19-04-2019 -64.70588235
20-04-2019 -66.66666667