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
评论列表
文章目录