How can I plot separate Pandas DataFrames as subplots?

后端 未结 9 2142
离开以前
离开以前 2020-11-22 17:00

I have a few Pandas DataFrames sharing the same value scale, but having different columns and indices. When invoking df.plot(), I get separate plot images. what

9条回答
  •  长发绾君心
    2020-11-22 17:40

    Building on @joris response above, if you have already established a reference to the subplot, you can use the reference as well. For example,

    ax1 = plt.subplot2grid((50,100), (0, 0), colspan=20, rowspan=10)
    ...
    
    df.plot.barh(ax=ax1, stacked=True)
    

提交回复
热议问题