plot.py 文件源码

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

项目:powerplantmatching 作者: FRESNA 项目源码 文件源码
def powerplant_map():
    with sns.axes_style('darkgrid'):
        df = set_uncommon_fueltypes_to_other(Carma_ENTSOE_ESE_GEO_OPSD_WRI_matched_reduced())
        shown_fueltypes = ['Hydro', 'Natural Gas', 'Nuclear', 'Hard Coal', 'Lignite', 'Oil']
        df = df[df.Fueltype.isin(shown_fueltypes) & df.lat.notnull()]
        fig, ax = plt.subplots(figsize=(7,5))

        scale = 5e1

        #df.plot.scatter('lon', 'lat', s=df.Capacity/scale, c=df.Fueltype.map(utils.tech_colors),
        #                ax=ax)
        ax.scatter(df.lon, df.lat, s=df.Capacity/scale, c=df.Fueltype.map(tech_colors2))

        ax.set_xlabel('')
        ax.set_ylabel('')
        draw_basemap()
        ax.set_xlim(-13, 34)
        ax.set_ylim(35, 71.65648314)
        ax.set_axis_bgcolor('white')
        fig.tight_layout(pad=0.5)

        legendcols = pd.Series(tech_colors2).reindex(shown_fueltypes)
        handles = sum(legendcols.apply(lambda x :
            make_legend_circles_for([10.], scale=scale, facecolor=x)).tolist(), [])
        fig.legend(handles, legendcols.index,
                   handler_map=make_handler_map_to_scale_circles_as_in(ax),
                   ncol=3, loc="upper left", frameon=False, fontsize=11)
        return fig, ax
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号