In Pandas versions prior to 23.4 I could do this:
df.plot(x=df.DateTime, y=['var1', 'var2'])
With df.DateTime as a datetime type. In v23.4 I get this error:
ValueError: x must be a label or position
I've been able to work around it based on advice in this thread: plot x-axis as date in matplotlib:
df = df.set_index(df.DateTime)
df.plot(y=['var1', 'var2']) # i.e. don't specify x
My question: is this the right way to approach this with current Pandas and Matplotlib versions?