本文整理汇总了Python中cartopy.feature.OCEAN属性的典型用法代码示例。如果您正苦于以下问题:Python feature.OCEAN属性的具体用法?Python feature.OCEAN怎么用?Python feature.OCEAN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cartopy.feature
的用法示例。
在下文中一共展示了feature.OCEAN属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_map
# 需要导入模块: from cartopy import feature [as 别名]
# 或者: from cartopy.feature import OCEAN [as 别名]
def _setup_map(
ax, xticks, yticks, crs, region, land=None, ocean=None, borders=None, states=None
):
"""
Setup a Cartopy map with land and ocean features and proper tick labels.
"""
if land is not None:
ax.add_feature(cfeature.LAND, facecolor=land)
if ocean is not None:
ax.add_feature(cfeature.OCEAN, facecolor=ocean)
if borders is not None:
ax.add_feature(cfeature.BORDERS, linewidth=borders)
if states is not None:
ax.add_feature(cfeature.STATES, linewidth=states)
ax.set_extent(region, crs=crs)
# Set the proper ticks for a Cartopy map
ax.set_xticks(xticks, crs=crs)
ax.set_yticks(yticks, crs=crs)
ax.xaxis.set_major_formatter(LongitudeFormatter())
ax.yaxis.set_major_formatter(LatitudeFormatter())
示例2: _setup_map
# 需要导入模块: from cartopy import feature [as 别名]
# 或者: from cartopy.feature import OCEAN [as 别名]
def _setup_map(
ax, xticks, yticks, crs, region, land=None, ocean=None, borders=None, states=None
):
"""
Setup a Cartopy map with land and ocean features and proper tick labels.
"""
import cartopy.feature as cfeature
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
if land is not None:
ax.add_feature(cfeature.LAND, facecolor=land)
if ocean is not None:
ax.add_feature(cfeature.OCEAN, facecolor=ocean)
if borders is not None:
ax.add_feature(cfeature.BORDERS, linewidth=borders)
if states is not None:
ax.add_feature(cfeature.STATES, linewidth=states)
ax.set_extent(region, crs=crs)
# Set the proper ticks for a Cartopy map
ax.set_xticks(xticks, crs=crs)
ax.set_yticks(yticks, crs=crs)
ax.xaxis.set_major_formatter(LongitudeFormatter())
ax.yaxis.set_major_formatter(LatitudeFormatter())
示例3: receiver_locations
# 需要导入模块: from cartopy import feature [as 别名]
# 或者: from cartopy.feature import OCEAN [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)
示例4: plot_base
# 需要导入模块: from cartopy import feature [as 别名]
# 或者: from cartopy.feature import OCEAN [as 别名]
def plot_base(self, bous = 1, bmap = None,
features = ['land','ocean','lake','river'],
gridline = True, lic = True):
"""
Plot map base
Parameters
----------
bous : TYPE, optional
DESCRIPTION. The default is 1.
bmap : TYPE, optional
DESCRIPTION. The default is None.
features : TYPE, optional
DESCRIPTION. The default is ['land','ocean','lake','river'].
gridline : TYPE, optional
DESCRIPTION. The default is True.
lic : TYPE, optional
DESCRIPTION. The default is True.
Returns
-------
None.
"""
if self.engine == 'gmt':
self.gmt_plot_base(self.region)
else:
self.fig.set_extent([72, 137, 10, 55])
self.fig.stock_img()
self.fig.coastlines()
self.fig.add_feature(cfeature.LAND)
self.fig.add_feature(cfeature.OCEAN)
self.fig.add_feature(cfeature.LAKES)
self.fig.add_feature(cfeature.RIVERS)
self.fig.gridlines(crs=ccrs.PlateCarree(), draw_labels=True)
datapath = Path(Path(catalog.__file__).parent,'data')
fname = Path(datapath, 'bou1_4l.shp')
f2name = Path(datapath, 'bou2_4l.shp')
faults = Path(datapath, 'gem_active_faults.shp')
self.fig.add_geometries(Reader(str(faults)).geometries(),
ccrs.PlateCarree(),facecolor = 'none',
edgecolor='red')
self.fig.add_geometries(Reader(str(f2name)).geometries(),
ccrs.PlateCarree(), facecolor = 'none',
edgecolor='gray', linestyle=':')
self.fig.add_geometries(Reader(str(fname)).geometries(),
ccrs.PlateCarree(), facecolor = 'none',
edgecolor='black')