How to return a matplotlib.figure.Figure object from Pandas plot function?

后端 未结 1 1701
面向向阳花
面向向阳花 2020-12-16 16:34

I have a dt:

>>> dt
            sales                mg         
ID         600519   600809   600519   600809
RPT_Date                          


        
相关标签:
1条回答
  • 2020-12-16 17:03

    You can get the figure from the axes object:

    ax.get_figure()
    

    Full example:

    df = pd.DataFrame({'a': range(10)})
    ax = df.plot.barh()
    ax.get_figure()
    
    0 讨论(0)
提交回复
热议问题