Reputation: 455
I am trying to plot a time-series data, but I'm facing some issue while plotting them like when I'm using function
pyplot.plot(ts)
graph is like
But when I'm using following function of python on same data then graph is like this
ts.plot()
I'm totally confused because of this. Any idea about this error?
Upvotes: 0
Views: 96
Reputation: 12417
Without the df, I can only make a guess. You should order the column which contains the dates. Try to apply this to the column of x-axis
where the dates are:
df = df.sort_values(by='your_column') #'your_column' is the columns with dates
Upvotes: 1