本文整理汇总了Python中cartopy.feature.COASTLINE属性的典型用法代码示例。如果您正苦于以下问题:Python feature.COASTLINE属性的具体用法?Python feature.COASTLINE怎么用?Python feature.COASTLINE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cartopy.feature
的用法示例。
在下文中一共展示了feature.COASTLINE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: receiver_locations
# 需要导入模块: from cartopy import feature [as 别名]
# 或者: from cartopy.feature import COASTLINE [as 别名]
def receiver_locations(locs: pandas.DataFrame):
if not isinstance(locs, pandas.DataFrame):
return
if cartopy is not None:
ax = figure().gca(projection=cartopy.crs.PlateCarree())
ax.add_feature(cpf.LAND)
ax.add_feature(cpf.OCEAN)
ax.add_feature(cpf.COASTLINE)
ax.add_feature(cpf.BORDERS, linestyle=':')
else:
ax = figure().gca()
for name, loc in locs.iterrows():
if 15 <= loc.interval < 30:
c = 'g'
elif 5 <= loc.interval < 15:
c = 'o'
elif loc.interval < 5:
c = 'r'
else: # large or undefined interval
c = 'b'
if np.isfinite(loc.interval):
ax.scatter(loc.lon, loc.lat, s=1000*1/loc.interval, c=c, label=name)
else:
ax.scatter(loc.lon, loc.lat, c=c, label=name)