答案 0 :(得分:0)
它是重复的Plot pandas dates in matplotlib
但是对于您的情况,答案如下
import numpy as np
import pandas as pd
time = pd.date_range(start='1971-01-01', end='2018-08-01', periods=100)
a= np.random.randint(60, high=165, size=100)
b= np.random.randint(20, high=60, size=100)
df = pd.DataFrame({'time': time, 'a': a, 'b': b})
df['time'] = df['time'].dt.date
df.set_index(['time'],inplace=True)
df.plot()