I’m trying to visualize a time-series. I have several days worth of data, but I’m not interested in the date, only in the time of the day (i.e. hours and minutes). I could not find a clean way of doing it, so I hacked my dataset by changing all the dates to the same day (see figure). This technically works and the scatter shows what I need (I’m not worried about the axis showing the date, I can edit the ticks). There are other ways I could manipulate the date and time in order to achieve the same results, but I was wondering if there was a clean way of showing just the time of the day, starting from date-like objects. I also tried using datetime.time
objects but they don’t seem to be recognized, only datetime.datetime
.
Thanks in advance!
The issue is there’s no such thing as ‘time’ in JavaScript (until Temporal comes out).
So the closest you’ll get it’s to transform your time to strings and get them ordered. It doesn’t work amazing when some times are missing.
Another option is to transform your time in number (e.g. 0-24h) and have custom tick labels.
I see. So the issue is more cross-language compatibility. But if I hear you, this could change in the future.
Thanks for bringing this up! I will make it work with what I have