python 2.7 - Plot multiple lines on subplots with pandas df.plot -
is there way plot multiple dataframe columns on 1 plot, several subplots dataframe?
e.g. if df has 12 data columns, on subplot 1, plot columns 1-3, subplot 2, columns 4-6, etc.
i understand how use df.plot have 1 subplot each column, not sure how group specified above.
thanks!
this example of how it:
import pandas pd import numpy np import matplotlib.pyplot plt fig, axes = plt.subplots(1, 2) np.random.seed([3,1415]) df = pd.dataframe(np.random.randn(100, 6), columns=list('abcdef')) df = df.div(100).add(1.01).cumprod() df.iloc[:, :3].plot(ax=axes[0]) df.iloc[:, 3:].plot(ax=axes[1])
Comments
Post a Comment