本文整理汇总了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')
示例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
示例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