我认为最简单的是按子集选择列然后DataFrame.plot
:
df[['ISP.MI','Ctrv']].plot()
如果你不关心轴刻度:
plt.figure() x = df['Date'] y1 = df['ISP.MI'] y2 = df['Ctrv'] plt.plot(x,y1) plt.plot(x,y2)
如果你关心它:
fig, ax1 = plt.subplots() x = df['Date'] y1 = df['ISP.MI'] y2 = df['Ctrv'] ax2 = ax1.twinx() ax1.plot(x, y1, 'g-') ax2.plot(x, y2, 'b-')