2
날짜 별 특정 이벤트의 분포를보고 싶습니다. 그래프의 각 점 사이의 시간을 일일이 볼 필요가 있습니다. 어떻게해야합니까? 여기그래프에서 점 사이의 일 수를 계산하고 입력하십시오.
date_time=[datetime.datetime.strptime(date_string, '%Y-%m-%d') for date_string in date_time]
dates = matplotlib.dates.date2num(date_time)
plt.scatter(date_time, [5]*len(dates))
plt.gcf().autofmt_xdate()
plt.show()
berna1111 @에 대한 답 고맙습니다 ['텍스트 '(http://matplotlib.org/api/입니다 text_api.html? highlight = text # module-matplotlib.text)를 사용하여 [이 예제들] (http://matplotlib.org/gallery.html#text_labels_and_annotations)과 같이 레이블을 배치 할 수 있습니다. – berna1111
@ berna1111 고맙습니다. 그것은 작동합니다. –