plot pandas dataframe two columns from
I think the simpliest is select columns by subset and then DataFrame.plot
:
df[['ISP.MI','Ctrv']].plot()
if you dont care about axis scale:
plt.figure()
x = df['Date']
y1 = df['ISP.MI']
y2 = df['Ctrv']
plt.plot(x,y1)
plt.plot(x,y2)
if you do care about it:
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-')
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
d = {'x' : [1,2,3,4,5,6,7,8,9,10],
'y_one' : np.random.rand(10),
'y_two' : np.random.rand(10)}
df = pd.DataFrame(d)
df.plot('x',y=['y_one','y_two'])
plt.show()