1
axvspan 내가 가진팬더 줄거리는
n
dates
2016-01-24 0
2016-02-26 98
2016-03-04 68
2016-03-26 45
2016-05-03 89
2016-05-09 83
2016-05-11 58
2016-07-29 53
2016-09-18 79
2016-10-20 57
내가 플롯 월과 3 월의 axvspan을하고 싶은 생성이
from datetime import date
import random
start_date = date.today().replace(day=1, month=1).toordinal()
end_date = date.today().toordinal()
df=pd.DataFrame.from_dict({'dates':[ date.fromordinal(random.randint(start_date, end_date)) for i in xrange(10) ]
,'n':np.random.randint(0,100,10)})
df.index=df['dates']; del df['dates']
df.sort_index(inplace=True)
같은 dataframe.
내 플로팅 코드는 간단하다 axvspan 내 날짜 내가 그 2개월 선택하고 사용하는 방법을 무작위이기 때문에 여기에
ax=df.plot()
는 axvspan (pd.datetime (2016, 2, 1), pd.datetime은 (2016,4,1)이) 당신이 원하는 무엇을 제공합니까? –
그게 작동합니다. 어떤 이유로 나는 ax.axvspan (pd.datetime (2016, 2, 1), pd.datetime (2016,4,1)) 루프를 사용하여 아무 것도 볼 수 없습니다. 그렇지 않으면 작동합니다. – NinjaGaiden