I have a DataFrame looking like this:
amount price
age
A 40929 4066443
B 93904 9611272
C 188349 19360005
D 248438 24335536
E
Here is an other method:
transform attributeHere is the code:
import pylab as pl
df = pd.DataFrame(np.random.rand(10, 2), columns=["left", "right"])
df["left"] *= 100
ax = df.plot(kind="bar")
ax2 = ax.twinx()
for r in ax.patches[len(df):]:
r.set_transform(ax2.transData)
ax2.set_ylim(0, 2);
here is the output:
