Pandas Secondary Axis

IIUC:

ax = df.plot('Date','A')
ax1 = ax.twinx()
df.plot('Date','B',ax=ax1, color="r")

Output:

enter image description here

Or you can use secondary_y in Pandas plot:

ax = df.plot('Date','A')
df.plot('Date','B',secondary_y=True, ax=ax)

Output:

enter image description here

Leave a Comment