当前位置: 首页>>代码示例>>Python>>正文


Python MapPlot.draw_cwas方法代码示例

本文整理汇总了Python中pyiem.plot.MapPlot.draw_cwas方法的典型用法代码示例。如果您正苦于以下问题:Python MapPlot.draw_cwas方法的具体用法?Python MapPlot.draw_cwas怎么用?Python MapPlot.draw_cwas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyiem.plot.MapPlot的用法示例。


在下文中一共展示了MapPlot.draw_cwas方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from pyiem.plot import MapPlot [as 别名]
# 或者: from pyiem.plot.MapPlot import draw_cwas [as 别名]
def main():
    """Go Main"""
    pgconn = get_dbconn('postgis')
    df = read_postgis("""
    select geom, issue from bot_warnings where wfo = 'PUB'
    """, pgconn, geom_col='geom', crs={'init': 'epsg:4326', 'no_defs': True})

    bounds = df['geom'].total_bounds
    # bounds = [-102.90293903,   40.08745967,  -97.75622311,   43.35172981]
    bbuf = 0.25
    mp = MapPlot(sector='custom', west=bounds[0] - bbuf,
                 south=bounds[1] - bbuf,
                 east=bounds[2] + bbuf, north=bounds[3] + bbuf,
                 continentalcolor='white',
                 title='Bot Issued Tornado Warnings [2008-2018] for PUB',
                 subtitle='%s warnings plotted' % (len(df.index), ))
    crs_new = ccrs.Mercator()
    crs = ccrs.PlateCarree()
    new_geometries = [crs_new.project_geometry(ii, src_crs=crs)
                      for ii in df['geom'].values]
    mp.draw_cwas()
    mp.ax.add_geometries(new_geometries, crs=crs_new,
                         edgecolor='r', facecolor='None', alpha=1., lw=0.5,
                         zorder=10)
    mp.postprocess(filename='test.png')
开发者ID:akrherz,项目名称:DEV,代码行数:27,代码来源:bot_warning_plot.py

示例2: test_cwa

# 需要导入模块: from pyiem.plot import MapPlot [as 别名]
# 或者: from pyiem.plot.MapPlot import draw_cwas [as 别名]
def test_cwa():
    """Exercise the cwa plotting routines"""
    mp = MapPlot(sector='cwa', cwa='MKX', nocaption=True)
    mp.contourf(np.arange(-94, -89), np.arange(40, 45),
                np.arange(5), np.arange(5),
                clevlabels=['a', 'b', 'c', 'd', 'e'])
    mp.draw_cwas()
    assert mp.cwa == 'MKX'
    return mp.fig
开发者ID:akrherz,项目名称:pyIEM,代码行数:11,代码来源:test_geoplot.py

示例3: test_illinois

# 需要导入模块: from pyiem.plot import MapPlot [as 别名]
# 或者: from pyiem.plot.MapPlot import draw_cwas [as 别名]
def test_illinois():
    """Produce a plot that doesn't suck"""
    mp = MapPlot(sector='state', state='IL', nocaption=True)
    mp.draw_cwas()
    return mp.fig
开发者ID:akrherz,项目名称:pyIEM,代码行数:7,代码来源:test_geoplot.py


注:本文中的pyiem.plot.MapPlot.draw_cwas方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。