當前位置: 首頁>>代碼示例>>Python>>正文


Python feature.OCEAN屬性代碼示例

本文整理匯總了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()) 
開發者ID:fatiando,項目名稱:verde,代碼行數:23,代碼來源:sample_data.py

示例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()) 
開發者ID:igp-gravity,項目名稱:geoist,代碼行數:25,代碼來源:fetch_data.py

示例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) 
開發者ID:geospace-code,項目名稱:georinex,代碼行數:30,代碼來源:plots_geo.py

示例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') 
開發者ID:igp-gravity,項目名稱:geoist,代碼行數:53,代碼來源:gratools.py


注:本文中的cartopy.feature.OCEAN屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。