I want to connect the orange dots to the blue dots.
Data Used: (pulled it using CSV lib)
handler,first_test,handler_arrived
hvvm-02,7/15/2020,1/26/2020
hvvm-03,4/8/2020,1/26/2020
hvvm-04,5/27/2020,1/26/2020
hvvm-07,7/8/2020,1/26/2020
hvvm-09,2/26/2020,1/7/2020
hvvm-10,2/26/2020,1/7/2020
hvvm-11,7/1/2020,1/6/2020
hvvm-12,7/15/2020,1/6/2020
I convert a list of strings to datetimes
first_test = [dt.datetime.strptime(date, '%m/%d/%Y').date() for date in first_test]
handler_arrive = [dt.datetime.strptime(date, '%m/%d/%Y').date() for date in handler_arrive]
Then I plot them:
scat1 = ax.scatter(first_test, handlers)
scat2 = ax.scatter(handler_arrive, handlers)
I tried to connect them by calling:
plt.plot_date(first_test, handler_arrive)
and this
plt.plot(first_test, handler_arrive, '-o')
I get this error
File "C:\Users\user\PycharmProjects\handler_enablement\venv\lib\site-packages\matplotlib\dates.py", line 342, in _from_ordinalf
dt = dt.astimezone(tz)
TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'UnitData'
So I try plt.plot_date(first_test, handler_arrive, tz=None)
(to try to shush the error) didn't work
At no point have I set a timezone nor did I need to, because I never got this error when messing with the datetimes before, so idk why this error occurs now. It must be how I am trying to connect the dots with that function call. It doesn't seem right...
I have tried these and they did not work
pandas scatter plotting datetime
Matplotlib connect scatterplot points with line - Python
What am I missing?