I am unable to show a bar and line graph on the same plot. Example code:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Df = pd.DataFrame(data=np.random.randn(10,4), index=pd.DatetimeIndex(start='2005', freq='M', periods=10), columns=['A','B','C','D'])
fig = plt.figure()
ax = fig.add_subplot(111)
Df[['A','B']].plot(kind='bar', ax=ax)
Df[['C','D']].plot(ax=ax, color=['r', 'c'])
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…