I'm trying to plot two data series:
- day of the year (X-axis):
['2019-01-01', '2019-01-02', ...] - hour of sunrise (Y-axis):
['07:04', '07:03', ...]
But matplotlib is getting me crazy… here's the plot of a subset (ax.plot(datelist[130:230], hourlist[130:230], label='sunrise')):
As you can see, the Y-axis decrease from '03:57' to '03:33' and, then, suddenly start to increase up to '04:26'. That's non-sense to me.
Can you help me fixing that ?
Bonus points if you tell me how to show a decent scale on both axis (i.e. 00:00 – 24:00 equally spaced by 1 hour with minor ticks; and a list of chosen dates for the X-axis).
Thank you in advance!


datetimeobjects first. (Otherwise, matplotlib cannot know that "2019-01-01" is a date.)