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


Python Basemap.drawrivers方法代码示例

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


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

示例1: generate_overviewbase

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def generate_overviewbase(
        width=2000000, height=1800000,
        resolution='l', projection='aea',
        lat_1=60., lat_2=70., lat_0=65, lon_0=-150,
        rivercolor=water, continentcolor=earth,
        lakecolor=water, oceancolor=water, 
        meridianrange=np.arange(-180, 180, 5),
        meridianlabels=[False, False, False, 1],
        parallelrange=np.arange(0, 80, 2),
        parallellabels=[1, 1, False, False]
        ):
    mm = Basemap(
        width=width, height=height, 
        resolution=resolution, 
        projection='aea', 
        lat_1=lat_1, lat_2=lat_2, lat_0=lat_0, lon_0=lon_0)
    mm.drawcoastlines()
    mm.drawrivers(color=rivercolor, linewidth=1.5)
    mm.drawmeridians(meridianrange, labels=meridianlabels)
    mm.drawparallels(parallelrange, labels=parallellabels)
    mm.fillcontinents(        
        color=continentcolor,
        lake_color=lakecolor)
    mm.drawmapboundary(fill_color=oceancolor)
#    mm.readshapefile(
#        "/Volumes/SCIENCE/GIS_Data/catalog.data.gov/tl_2013_02_prisecroads/tl_2013_02_prisecroads", 
#        'roads', 
#        color="slategrey", linewidth=2)
    return mm
开发者ID:chryss,项目名称:satelliteremotesensing,代码行数:31,代码来源:viirstools.py

示例2: plot_locations

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def plot_locations(result,amenity,top): 
    import pandas as pd
    import numpy
        
    lat = []
    lon = []
    for res in result:
        lat.append(res['pos'][0])
        lon.append(res['pos'][1])       
    
    geo = pd.DataFrame(lat, columns = ['lat'])
    geo['lon'] = lon
    
    from mpl_toolkits.basemap import Basemap
    import matplotlib.pyplot as plt
     
    my_map = Basemap(projection='merc', lat_0=geo.median()[0], lon_0=geo.median()[1],
        resolution = 'h', area_thresh = .1,
        llcrnrlon=geo.min()[1]-.1, llcrnrlat=geo.min()[0]-.1,
        urcrnrlon=geo.max()[1]+.1, urcrnrlat=geo.max()[0]+.1)
     
    my_map.drawrivers()
    my_map.drawcounties()
    my_map.fillcontinents(color='tan')
    my_map.drawmapboundary()
    my_map.drawcoastlines()
   
    x,y = my_map(lon, lat)
    my_map.plot(x,y, 'bo', markersize=2)
    
    title = 'Map Showing %s Added by \"%s\"\nThe Top %s Editor' % (str(amenity).title(),str(top),str(amenity).title())
    plt.title(title)
    p = plt.show()
    
    return p
开发者ID:afoss-UCUP,项目名称:mongoDB-OpenStreetMap,代码行数:37,代码来源:plotting_functions.py

示例3: draw_bb_map

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
    def draw_bb_map(self, fig, ax, BB=None, range_rings=None, lat_spacing=None, lon_spacing=None):
        """Draw the Beam Blockage"""
        if BB is None:
            BB = self.CBB

        if lat_spacing is None:
            lat_spacing = 1.0
        if lon_spacing is None:
            lon_spacing = 1.0

        bm2 = Basemap(
            projection="cea",
            resolution="l",
            area_thresh=10000.0,
            llcrnrlon=self.minlon,
            urcrnrlon=self.maxlon,
            llcrnrlat=self.minlat,
            urcrnrlat=self.maxlat,
            ax=ax,
        )
        ax.set_title("Beam-blockage fraction", fontdict=TITLEDICT)
        bm2.drawmeridians(np.arange(self.minlon, self.maxlon, lon_spacing), labels=[1, 0, 0, 1])
        bm2.drawparallels(np.arange(self.minlat, self.maxlat, lat_spacing), labels=[1, 0, 0, 1])
        bm2.drawcountries()
        bm2.drawcoastlines()
        bm2.drawrivers()

        xbm2, ybm2 = bm2(self.rng_lon, self.rng_lat)
        BBmap = bm2.pcolormesh(xbm2, ybm2, BB, vmin=0.0, vmax=1.0, cmap=self.bb_cmap)
        if range_rings is not None:
            for nn in range(len(range_rings)):
                self.plot_range_ring(range_rings[nn], bm=bm2)
        fig.colorbar(BBmap, ax=ax)
开发者ID:nguy,项目名称:PyRadarMet,代码行数:35,代码来源:BeamBlock.py

示例4: test_plot_map_vels

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def test_plot_map_vels(xml):
    track = GPX(xml)
    vels = track.calculate_vels(smooth_vels=True)

    lllat, lllon = min(track.lat) - 0.01, min(track.lon) - 0.01
    urlat, urlon = max(track.lat) + 0.01, max(track.lon) + 0.01

    # find the centre point
    lat_0 = (urlat - lllat) / 2 + lllat
    lon_0 = (urlon - lllon) / 2 + lllon

    # FIXME: rsphere required because my Proj is screwy
    m = Basemap(projection='cyl',
                llcrnrlon=lllon, llcrnrlat=lllat,
                urcrnrlon=urlon, urcrnrlat=urlat,
                lat_0=lat_0, lon_0=lon_0,
                resolution='h')
                # rsphere=(6378137.00, 6356752.3142))

    x, y = m(vels.lon, vels.lat)

    m.drawcoastlines()
    m.drawrivers()
    m.barbs(x, y, vels.u, vels.v) #, vels.anom, cmap=plt.get_cmap('RdBu_r'))
    plt.show()
开发者ID:danni,项目名称:cycle-router,代码行数:27,代码来源:test_gpx.py

示例5: plot

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def plot(lon, lat, h):
    m = Basemap(projection='gall',
                llcrnrlon=-94.5,
                llcrnrlat=28.5,
                urcrnrlon=-88.5,
                urcrnrlat=34,
                resolution='f',
                area_thresh=50.0,
                lat_0=31.30, lon_0=-92.60
                )
    fig = plt.figure()
    fig.suptitle('Local of Type host '+h, fontsize=10)
    m.drawcoastlines()
    m.drawcountries()
    m.drawstates()
    m.drawrivers(linewidth=0.5, linestyle='solid', color='steelblue',
                 antialiased=1, ax=None, zorder=None)
    parallels = np.arange(0., 90, 0.5)
    m.drawparallels(parallels, labels=[False, True, True, False])
    meridians = np.arange(10., 351., 1)
    m.drawmeridians(meridians, labels=[True, False, False, True])
    m.fillcontinents(color='gainsboro')
    m.drawmapboundary(fill_color='steelblue')
    xpt, ypt = m(lon, lat)
    lonpt, latpt = m(xpt, ypt, inverse=True)
    m.plot(xpt, ypt, 'bo')
    plt.show()
开发者ID:zcarver,项目名称:mGhost,代码行数:29,代码来源:mycosGeoHost.py

示例6: plotwithrivers

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def plotwithrivers(lat, lon, lat2 = None, lon2 = None):
    #Plots equal length arrays lat and lon of latitudes and longitudes. WITH RIVERS
    latLL = min(lat)
    lonLL = min(lon)
    latUR = max(lat)
    lonUR = max(lon)
    meanlat = np.mean(lat)
    meanlon = np.mean(lon)
    map = Basemap(projection='merc'
    ,llcrnrlon= lonLL - 1,llcrnrlat=latLL -1
     , urcrnrlon= lonUR+1,urcrnrlat= latUR+1,resolution='h')

    #map = Basemap(projection='spstere', boundinglat = latUR +1, lon_0 = meanlon)

    # draw coastlines, country boundaries, fill continents.
    map.drawcoastlines(linewidth=0.5)
    map.drawcountries(linewidth=0.5)
    # map.fillcontinents(color='coral',lake_color='aqua')

    # draw the edge of the map projection region (the projection limb)
    #map.drawmapboundary(fill_color='aqua')

    # draw lat/lon grid lines every 30 degrees.
    map.drawmeridians(np.arange(0,360,1))
    map.drawparallels(np.arange(-90,90,1))

    #map.bluemarble() #NASA image - kek
    map.drawrivers(linewidth=0.5)
    map.scatter(lon,lat, latlon = True)
    try:
        map.scatter(lon2,lat2,latlon = True , color = 'g')
    except:
        print("")
开发者ID:Mchristos,项目名称:GPStools,代码行数:35,代码来源:GPSmodule.py

示例7: plotMap

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def plotMap(llcrnrlon, llcrnrlat, urcrnrlon, urcrnrlat, 
            lons, lats, color, title):
        m = Basemap(projection='merc',
                    resolution='i', 
                    llcrnrlon = llcrnrlon,
                    llcrnrlat = llcrnrlat,
                    urcrnrlon = urcrnrlon,
                    urcrnrlat = urcrnrlat)

        m.drawcountries(linewidth=1)
        m.drawcoastlines(linewidth=1)
        m.drawlsmask()
        m.drawstates()
        m.drawrivers(linewidth=.1)

        plt.title((str(len(lats)))+ \
            title,
            fontsize=12)

        x,y = m(lons, lats)
        if color == 'r':
            plt.hexbin(x, y, gridsize=40, cmap=plt.cm.Reds)
        if color == 'b':
            plt.hexbin(x, y, gridsize=40, cmap=plt.cm.Blues)        
        if color == 'g':
            plt.hexbin(x, y, gridsize=40, cmap=plt.cm.Greens)
        m.scatter(lons, lats, 1, marker='o',color=color, latlon=True)
        plt.show()
开发者ID:JRMeyer,项目名称:twitter,代码行数:30,代码来源:geoPlotting.py

示例8: background_map

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
 def background_map(self, ax):
     llcrnrlat, urcrnrlat, llcrnrlon, urcrnrlon, lat_ts = (31, 44, -126, -113, 37.5)
     m = Basemap(projection='merc', llcrnrlat=llcrnrlat,
                 urcrnrlat=urcrnrlat, llcrnrlon=llcrnrlon, urcrnrlon=urcrnrlon,
                 lat_ts=lat_ts, resolution='i', ax=ax)
     m.drawmapboundary(fill_color='lightblue', zorder=0)
     m.fillcontinents(zorder=0)
     etopofn = '/home/behry/uni/data/etopo1_central_europe_gmt.grd'
     etopodata = Dataset(etopofn, 'r')
     z = etopodata.variables['z'][:]
     x_range = etopodata.variables['x_range'][:]
     y_range = etopodata.variables['y_range'][:]
     spc = etopodata.variables['spacing'][:]
     lats = np.arange(y_range[0], y_range[1], spc[1])
     lons = np.arange(x_range[0], x_range[1], spc[0])
     topoin = z.reshape(lats.size, lons.size, order='C')
     # transform to nx x ny regularly spaced 5km native projection grid
     nx = int((m.xmax - m.xmin) / 5000.) + 1; ny = int((m.ymax - m.ymin) / 5000.) + 1
     topodat, x, y = m.transform_scalar(np.flipud(topoin), lons, lats, nx, ny, returnxy=True)
     ls = LightSource(azdeg=300, altdeg=15, hsv_min_sat=0.2, hsv_max_sat=0.3,
                      hsv_min_val=0.2, hsv_max_val=0.3)
     # shade data, creating an rgb array.
     rgb = ls.shade(np.ma.masked_less(topodat / 1000.0, 0.0), cm.gist_gray_r)
     m.imshow(rgb)
     m.drawmeridians(np.arange(6, 12, 2), labels=[0, 0, 0, 1], color='white',
                     linewidth=0.5, zorder=0)
     m.drawparallels(np.arange(44, 50, 2), labels=[1, 0, 0, 0], color='white',
                     linewidth=0.5, zorder=0)
     m.drawcoastlines(zorder=1)
     m.drawcountries(linewidth=1.5, zorder=1)
     m.drawstates()
     m.drawrivers(color='lightblue', zorder=1)
     return m
开发者ID:FMassin,项目名称:SRL_2015,代码行数:35,代码来源:eewvs_alert_times.py

示例9: get_catalog_map

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def get_catalog_map(lats=None, lons=None, eq_cat=[], map_res='i', map_projection='cyl', fignum=0, ax=None, do_clf=True):
	#
	if lats==None: lats = [31., 42.]
	if lons==None: lons = [-125., -114.]
	#
	if fignum!=None: plt.figure(fignum)
	if do_clf: plt.clf()
	if ax==None: ax=plt.gca()
	#
	cm = Basemap(llcrnrlon=lons[0], llcrnrlat=lats[0], urcrnrlon=lons[1], urcrnrlat=lats[1], resolution=map_res, projection=map_projection, lon_0=numpy.mean(lons), lat_0=numpy.mean(lats), ax=ax)
	cm.drawcoastlines(color='gray', zorder=1)
	cm.drawcountries(color='gray', zorder=1)
	cm.drawstates(color='gray', zorder=1)
	cm.drawrivers(color='gray', zorder=1)
	cm.fillcontinents(color='beige', zorder=0)
	# drawlsmask(land_color='0.8', ocean_color='w', lsmask=None, lsmask_lons=None, lsmask_lats=None, lakes=True, resolution='l', grid=5, **kwargs)
	#cm.drawlsmask(land_color='0.8', ocean_color='c', lsmask=None, lsmask_lons=None, lsmask_lats=None, lakes=True, resolution=mapres, grid=5)

	print("lat, lon ranges: ", lats, lons)
	cm.drawmeridians(list(range(int(lons[0]), int(lons[1]))), color='k', labels=[0,0,1,1])
	cm.drawparallels(list(range(int(lats[0]), int(lats[1]))), color='k', labels=[1, 1, 0, 0])
	#
	if eq_cat!=None:
		# can we also assign sizes dynamically, like colors?
		if hasattr(eq_cat, 'dtype'):
			# it's a recrray:
			X,Y = cm(eq_cat['lon'], eq_cat['lat'])
		else:
			# it's probably a list... though we should check for dicts, etc.
			X,Y = cm([rw[2] for rw in eq_cat], [rw[1] for rw in eq_cat])
		#
		cm.plot(X,Y, '.')
				
	#
	return cm
开发者ID:markyoder,项目名称:ETASmf,代码行数:37,代码来源:ETASgeom.py

示例10: makeMap

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def makeMap(latList, lonList, cityList):
    minLon = -130
    minLat = 25
    maxLon = -60
    maxLat = 50

    # Below is used to offset a bit the labels of the cities, for projection='merc'.
    labelYOffset = -0.9
    labelXOffset = 0.8

    # Below is used to offset a bit the labels of the cities, for projection='cyl'.
    #labelYOffset = -0.4
    #labelXOffset = 0.8

    plt.figure(1, figsize=(15, 15))
    myMap = Basemap(minLon, minLat, maxLon, maxLat, projection='merc', resolution='h')
    myMap.drawcoastlines()
    # Below if we want to show counties.
    #myMap.drawcounties(linewidth=1, linestyle='solid', color='red')
    # Below if we want to show states.
    #myMap.drawstates(linewidth=2, linestyle='solid', color='green')
    myMap.drawcountries(linewidth=3, linestyle='solid', color='black')
    myMap.drawrivers(linewidth=1, linestyle='solid', color='blue')

    # Another nice option is shaderelief().
    #myMap.shadedrelief()
    myMap.etopo()

    myMap.scatter(latList, lonList, latlon=True, c='red', s=100)
    X, Y = myMap(latList, lonList)
    # The for loop is to add the text labels of the cities.
    for x, y, label in zip(X, Y, cityList):
        plt.text(x + labelXOffset, y + labelYOffset, label)

    return plt.show()
开发者ID:carlespoles,项目名称:python-DataScience-UCI,代码行数:37,代码来源:Carles_Poles_Mielgo_week4.py

示例11: map_interiorAK

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def map_interiorAK(
    width=1800000,
    height=1200000,
    water='lightskyblue',
    earth='snow',
    resolution='i'):
    """
    Albers Equal Area map of interior Alaska, with some overridable presets.
    """
    bmap = Basemap(
        width=width,
        height=height,
        resolution=resolution,
        projection='aea',
        lat_1=55., lat_2=75., lat_0=65., lon_0=-150.)
    bmap.drawcoastlines()
    bmap.drawrivers(color=water)
    bmap.drawcountries()
    bmap.fillcontinents(lake_color=water, color=earth)
    # labels = [left,right,top,bottom]
    bmap.drawmeridians(
        np.arange(-180, 180, 10), labels=[False, False, False, 1])
    bmap.drawparallels(
        np.arange(0, 80, 5), labels=[1, 1, False, False])
    bmap.drawmapboundary(fill_color=water)
    return bmap
开发者ID:chris4540,项目名称:pygaarst,代码行数:28,代码来源:basemaputils.py

示例12: basemap_standard

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def basemap_standard(lat,lon,parallels_interval):
    # parallels_interval is the # of degrees between longitude labels
    ## plot the coastline   
    #set up the map in a Equidistant Cylindrical projection
    #Note: See "oceanographic_python.doc" on how to download and install the 3rd party "Basemap" package
    
    #m = Basemap(projection='cyl',llcrnrlat=min(lat)-0.01,urcrnrlat=max(lat)+0.01,\
    #        llcrnrlon=min(lon)-0.01,urcrnrlon=max(lon)+0.01,resolution='h')#,fix_aspect=False)
    m = Basemap(projection='cyl',llcrnrlat=min(lat),urcrnrlat=max(lat),\
            llcrnrlon=min(lon),urcrnrlon=max(lon),resolution='h')#,fix_aspect=False)
    #  draw coastlines
    m.drawcoastlines()
    m.fillcontinents(color='grey')
    m.drawmapboundary()
    #draw major rivers
    m.drawrivers()
    #print 'new3\n'
    #print str(parallels_interval)
    if  parallels_interval[0]<6.0:
        parallels_interval=parallels_interval[0]
        #draw parallels
        #m.drawparallels(np.arange(int(min(lat)),int(max(lat))+1,float(parallels_interval)),linewidth=0,labels=[1,0,0,0],fmt=lat2str,dashes=[1,1])
        #draw meridians
        #m.drawmeridians(np.arange(int(min(lon)),int(max(lon))+1,float(parallels_interval)),linewidth=0,labels=[0,0,0,1],fmt=lon2str,dashes=[2,2])     
        m.drawparallels(np.arange(min(lat),max(lat)+1,float(parallels_interval)),linewidth=1,labels=[1,0,0,0],fmt=lat2str,dashes=[1,1])
        #draw meridians
        m.drawmeridians(np.arange(min(lon),max(lon)+1,float(parallels_interval)),linewidth=1,labels=[0,0,0,1],fmt=lon2str,dashes=[2,2])     
    else:
        parallels_interval=parallels_interval[0]
        m.drawparallels(np.arange(min(lat),max(lat)+1,float(parallels_interval)),linewidth=1,labels=[1,0,0,0],fmt=lat2str,dashes=[1,1])
        m.drawmeridians(np.arange(min(lon),max(lon)+1,float(parallels_interval)),linewidth=1,labels=[0,0,0,1],fmt=lon2str,dashes=[1,1])     
        print 'this is '+str(parallels_interval)
开发者ID:dzbhhz,项目名称:study_fleet,代码行数:34,代码来源:basemap.py

示例13: plot_species_occurrence

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
    def plot_species_occurrence(self, figsize=(16,12), projection='merc'):
        data_clean = self.data_full.dropna(how='any', subset=['decimalLatitude', 'decimalLongitude'])

        # latitude/longitude lists
        data_full_latitude = data_clean.decimalLatitude
        data_full_longitude = data_clean.decimalLongitude

        plt.figure(figsize=figsize)
        plt.title("%s occurrence records from %s " 
            % (self.name_species, self.source.name)
            )

        my_map = Basemap(projection=projection, lat_0=50, lon_0=-100,
                        resolution='l', area_thresh=1000.0, 
                        llcrnrlon=data_full_longitude.min(),# lower left corner longitude point 
                        llcrnrlat=data_full_latitude.min(), # lower left corner latitude point
                        urcrnrlon=data_full_longitude.max(), # upper right longitude point
                        urcrnrlat=data_full_latitude.max() # upper right latitude point
                        )
        # prepare longitude/latitude list for basemap
        df_x, df_y = my_map(data_full_longitude.tolist(), data_full_latitude.tolist())
        my_map.drawcoastlines()
        my_map.drawcountries()
        my_map.drawrivers(color='lightskyblue', linewidth=1.5)
        my_map.drawmapboundary(fill_color='lightskyblue')
        my_map.fillcontinents(color='cornsilk')
        # draw latitude and longitude
        my_map.drawmeridians(np.arange(0, 360, 30))
        my_map.drawparallels(np.arange(-90, 90, 30))
        my_map.plot(df_x, df_y, 'bo', markersize=5, color="#b01a1a")
开发者ID:gitter-badger,项目名称:iSDM,代码行数:32,代码来源:species.py

示例14: basemap_standard

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def basemap_standard(lat,lon,*parallels_interval):
    ## plot the coastline   
    #set up the map in a Equidistant Cylindrical projection
    #Note: See "oceanographic_python.doc" on how to download and install the 3rd party "Basemap" package
    from mpl_toolkits.basemap import Basemap
    m = Basemap(projection='cyl',llcrnrlat=min(lat)-0.01,urcrnrlat=max(lat)+0.01,\
            llcrnrlon=min(lon)-0.01,urcrnrlon=max(lon)+0.01,resolution='h')#,fix_aspect=False)
  #  draw coastlines
    m.drawcoastlines()
    m.fillcontinents(color='grey')
    m.drawmapboundary()
    #draw major rivers
    m.drawrivers()
    if len(parallels_interval)<1:
        parallels_interval=1
        #draw parallels
        m.drawparallels(np.arange(int(min(lat)),int(max(lat))+1,float(parallels_interval)),linewidth=0,labels=[1,0,0,0],fmt=lat2str,dashes=[2,2])
        #draw meridians
        m.drawmeridians(np.arange(int(min(lon)),int(max(lon))+1,float(parallels_interval)),linewidth=0,labels=[0,0,0,1],fmt=lon2str,dashes=[2,2])     
    else:
        parallels_interval=parallels_interval[0]
        #draw parallels
        m.drawparallels(np.arange(round(min(lat)-0.2,3),round(max(lat)+0.2,3),parallels_interval),labels=[1,0,0,0],fmt=lat2str,dashes=[2,2])
        #draw meridians
        m.drawmeridians(np.arange(round(min(lon)-0.2,3),round(max(lon)+0.2,3),parallels_interval),labels=[0,0,0,1],fmt=lon2str,dashes=[2,2]) 
开发者ID:yacheng1127,项目名称:pyocean,代码行数:27,代码来源:basemap.py

示例15: nepal_basemap

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawrivers [as 别名]
def nepal_basemap(prams = nepal_ETAS_prams, fnum=0, map_res='i', **kwargs):
	# hours_after: upper time limit for aftershocks to plot.
	prams.update(kwargs)
	#
	lons_nepal = [83., 87.]
	lats_nepal = [26., 30.]
	
	todt=prams.get('todt', None)
	catlen=prams.get('catlen', 5.*365.)
	lons=prams['lons']
	lats=prams['lats']
	mc = prams['mc']
	#
	if todt==None: todt = dtm.datetime.now(pytz.timezone('UTC'))
	dt0 = todt - dtm.timedelta(days=catlen)
	#
	plt.figure(fnum)
	plt.clf()
	ax1=plt.gca()
	cntr = [.5*(lons[0]+lons[1]), .5*(lats[0]+lats[1])]
	#
	cm=Basemap(llcrnrlon=lons_nepal[0], llcrnrlat=lats_nepal[0], urcrnrlon=lons_nepal[1], urcrnrlat=lats_nepal[1], resolution=map_res, projection='cyl', lon_0=cntr[0], lat_0=cntr[1])
	cm.drawcoastlines(color='gray', zorder=1)
	cm.drawcountries(color='gray', zorder=1)
	cm.drawstates(color='gray', zorder=1)
	cm.drawrivers(color='gray', zorder=1)
	cm.fillcontinents(color='beige', zorder=0)
	#
	cm.drawmeridians(list(range(int(lons[0]), int(lons[1]))), color='k', labels=[0,0,1,1])
	cm.drawparallels(list(range(int(lats[0]), int(lats[1]))), color='k', labels=[1, 1, 0, 0])
	#
	return cm
开发者ID:markyoder,项目名称:ETASmf,代码行数:34,代码来源:china_2015_scripts.py


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