I have data of days from all days from 2004-01-01 until 2015-31-12 and want to plot the maximum and the minimun value of each day.
The original data is on df
and df['Day']
is a colum with day and month.
So, I created two new dataframes:
dfmin=df.groupby('Day').agg('min')
dfmax=df.groupby('Day').agg('max')
The new dataframes has one row for each day of the year, considering the max and the minimun value for each day in the range.
I want to label the axis with each day, but without specify any year. I already saw this questions and this documentation but did not find the answer.
For example, I did:
observation_dates = np.arange('2013-01-01', '2014-01-01', dtype='datetime64[D]')
plt.plot(dfmin.index, dfmin.Data_Value)
plt.plot(dfmin.index, dfmax.Data_Value)
...
And created the following chart:
But I would like to do something like:
observation_dates = np.arange(' -01-01', ' -01-01', dtype='datetime64[D]')
...
So the axis would be labeled just with the days, but without specifying any year
EDIT TO CLARIFY A LITTLE MORE:
After group the data by days, I got the following dataframe (represented by the blue line at the chart):
DAY Data_Value
01-01 -160
01-02 -267
01-03 -267
I just want to plot this values using dates at x-axis