Right now I have a graph of this sort:
But I want to make the above graph into something like this:
Can anyone guide me how to do this using Matplotlib?
CodePudding user response:
try plotting the first difference of your time series such as:
# sample data (this is your "before" data):
df = pd.DataFrame({'data you are plotting now': [1, 2, 3, 4]})
# new data to plot:
df['new data'] = df['data you are plotting now'] - df['data you are plotting now'].shift()
assuming data['data you are plotting now']
is your current time series
I should add that generally you should add your code and your input data as well as your expected output data and not images.