plot.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:powerplantmatching 作者: FRESNA 项目源码 文件源码
def hbar_country_totals(dfs, keys, exclude_fueltypes=['Solar', 'Wind'],
                        figsize=(7,5), unit='GW'):
    with sns.axes_style('whitegrid'):
        fig, ax = plt.subplots(1,1, figsize=figsize)
        countrytotals = lookup(dfs,
                   keys=keys, by='Country',
                    exclude=exclude_fueltypes,show_totals=True,
                    unit=unit)
        countrytotals[::-1][1:].plot(kind="barh",
                           ax=ax, legend='reverse', edgecolor='none')
        ax.set_xlabel('Capacity [%s]'%unit)
        ax.yaxis.grid(False)
        ax.set_ylabel('')
        fig.tight_layout(pad=0.5)
        return fig, ax
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号