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


Python Basemap.drawmapscale方法代码示例

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


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

示例1: make_straits_map

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
def make_straits_map():
    """ Makes a map of the Straits.
    """
    map = Basemap(resolution='i', projection='tmerc', lat_0 = 51.1515367, lon_0 = -0.8575194,llcrnrlon=-0.871,
                  llcrnrlat=51.148, urcrnrlon=-0.846, urcrnrlat=51.159)#, epsg=4326)
    folder_list = ['su73ne.shp', 'su74se.shp', 'su83nw.shp', 'su84sw.shp']
    subfolder_list = ['Area', 'Line', 'RoadCLine', 'Text', 'VectorMapPoint']
    for x in folder_list:
        for t in subfolder_list:
            if t=='Line':
                map.readshapefile(x+'/'+t, 'out', color='b', linewidth=0.3)
            else:
                map.readshapefile(x+'/'+t, 'out', linewidth=0.7)

    map.drawmapscale(-0.8690655121821721, 51.149290623473476, 0, 0, 100, units='m')
    return map
开发者ID:Ewan82,项目名称:straits_map,代码行数:18,代码来源:straits_map.py

示例2: plotBase

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
def plotBase(fig, dt=None):
    m = Basemap(projection='merc',
                lon_0=0,lat_0=0,lat_ts=0,
                llcrnrlat=0,urcrnrlat=50,
                llcrnrlon=-100,urcrnrlon=-50,
                resolution='l')
    m.drawcountries(linewidth=1, color='k')
    m.drawmapscale(-90, 5, -90, 5, 1000, barstyle='fancy')
    m.bluemarble(scale=1)

    # Get Position of NYC, longitude -74.0064, latitude 40.7142
    x,y    = m(-74.0064, 40.7142)
    # Plot NYC
    m.scatter(x, y, s=100,  marker='*', color='0.5', alpha=1)
    plt.text(x,y,'NYC', fontsize='15')

    if dt is not None: m.nightshade(dt, alpha = 0.3)
    return m
开发者ID:elixir67,项目名称:Sandbox,代码行数:20,代码来源:hurricanetrack.py

示例3: draw_map

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
def draw_map(lon_column, lat_column, subplot=1, cmap='Blues'):
    plt.subplot(2, 1, subplot)
    m = Basemap(projection='merc', resolution = 'h', urcrnrlon=-8.5363740000000004, urcrnrlat=41.237622000000002, llcrnrlon=-8.6920289999999998, llcrnrlat=41.112071999999998)
    m.readshapefile('./data/roads', 'landmarks')
    m.drawcoastlines()
    m.drawrivers()
    m.drawcountries()
    m.drawmapboundary()

    lon_bins = np.linspace(lon_column.min() - 1, lon_column.max() + 1, 500)
    lat_bins = np.linspace(lat_column.min() - 1, lat_column.max() + 1, 500)

    density, _, _ = np.histogram2d(lat_column, lon_column, [lat_bins, lon_bins])

    lon_bins_2d, lat_bins_2d = np.meshgrid(lon_bins, lat_bins)

    xs, ys = m(lon_bins_2d, lat_bins_2d)

    plt.pcolormesh(xs, ys, density, cmap=plt.get_cmap(cmap))
    plt.colorbar(orientation='horizontal')

    m.scatter(lon_column.tolist(), lat_column.tolist(), alpha=0.00125, latlon=True, c='green')

    m.drawmapscale(-8.685, 41.14, -8.685, 41.14, 1)
开发者ID:sornars,项目名称:pkdd_15_predict_taxi_service_trajectory_i,代码行数:26,代码来源:main.py

示例4: dict

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
#Adicione a linha de costa.
m.drawcoastlines(linewidth=1)

# Adicione os continentes.
m.fillcontinents(color='#000000')

# Adicione os paralelos e meridianos .
m.drawparallels(np.arange(-90.,120.,10.), linewidth=0.1, dashes = [1,5], color='black', labels=[1,0,0,1],labelstyle="+/-")
m.drawmeridians(np.arange(-180.,180.,10.), linewidth=0.1,dashes = [1,5], color='black', labels=[1,0,0,1],labelstyle="+/-")

# Adicione países
m.drawcountries(color = '#ffffff')

# Adicione uma escala ao mapa.
m.drawmapscale(-25,-50,lon.min(),lat.max(),1500, barstyle='fancy', units='km', labelstyle='simple',fillcolor1='w');

# Defina para plotar uma variável.
kw = dict(levels=range(-5,5,1),cmap=cm.balance,latlon=True)
lon,lat = np.meshgrid(lat, lat)
Cf = m.contourf(lon,lat,stab,**kw);
cbar = plt.colorbar(Cf);
cbar.ax.set_ylabel(ylabel) #precisamos acessar o objeto ax dentro de cbar

Cb = m.contour(stab,20,linewidths=2.0, colors='darkgreen', linestyles='-')
# Adicione um título.
plt.title(titulo)

# Salve o arquivo
plt.show()
plt.savefig(salvar,dpi=500)
开发者ID:uesleisutil,项目名称:python,代码行数:32,代码来源:wrf_temperatura.py

示例5: PolygonPatch

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
ax = fig.add_subplot(111, axisbg='w', frame_on=False)

cmap = plt.get_cmap('Blues')
# draw neighborhoods with grey outlines
df_map['patches'] = df_map['poly'].map(lambda x: PolygonPatch(x, ec='#111111', lw=.8, alpha=1., zorder=4))
pc = PatchCollection(df_map['patches'], match_original=True)
# apply our custom color values onto the patch collection
cmap_list = [cmap(val) for val in (df_map.jenks_bins.values - df_map.jenks_bins.values.min())/(
                  df_map.jenks_bins.values.max()-float(df_map.jenks_bins.values.min()))]
pc.set_facecolor(cmap_list)
ax.add_collection(pc)

#Draw a map scale
m.drawmapscale(coords[0] + 0.08, coords[1] + -0.01,
    coords[0], coords[1], 10.,
    fontsize=16, barstyle='fancy', labelstyle='simple',
    fillcolor1='w', fillcolor2='#555555', fontcolor='#555555',
    zorder=5, ax=ax,)

# ncolors+1 because we're using a "zero-th" color
cbar = custom_colorbar(cmap, ncolors=len(jenks_labels)+1, labels=jenks_labels, shrink=0.5)
cbar.ax.tick_params(labelsize=16)

fig.suptitle("    Time Spent in Seattle Neighborhoods", fontdict={'size':24, 'fontweight':'bold'}, y=0.92)
ax.set_title("  Using location data collected from my Android phone via Google Takeout", fontsize=14, y=0.98)
ax.text(1.35, 0.04, "Collected from 2012-2014 on Android 4.2-4.4\nGeographic data provided by data.seattle.gov", 
        ha='right', color='#555555', style='italic', transform=ax.transAxes)
ax.text(1.35, 0.01, "BeneathData.com", color='#555555', fontsize=16, ha='right', transform=ax.transAxes)
plt.savefig('chloropleth.png', dpi=300, frameon=False, transparent=False, bbox_inches='tight', pad_inches=0.5)

# <headingcell level=2>
开发者ID:tylerhartley,项目名称:personal,代码行数:33,代码来源:latitude-blogcopy.py

示例6: LinearSegmentedColormap

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
                   (1.0,  0.9,  1.0) ),
         'green':( (0.0,  1.0,  1.0),
                   (1.0,  0.03, 0.0) ),
         'blue': ( (0.0,  1.0,  1.0),
                   (1.0,  0.16, 0.0) ) }
custom_map = LinearSegmentedColormap('custom_map', cdict)
plt.register_cmap(cmap=custom_map)


# add histogram squares and a corresponding colorbar to the map:
plt.pcolormesh(xs, ys, density, cmap="custom_map")

cbar = plt.colorbar(orientation='horizontal', shrink=0.625, aspect=20, fraction=0.2,pad=0.02)
cbar.set_label('Number of earthquakes',size=18)
#plt.clim([0,100])


# translucent blue scatter plot of epicenters above histogram:    
x,y = m(lons, lats)
m.plot(x, y, 'o', markersize=5,zorder=6, markerfacecolor='#424FA4',markeredgecolor="none", alpha=0.33)
 
    
# http://matplotlib.org/basemap/api/basemap_api.html#mpl_toolkits.basemap.Basemap.drawmapscale
m.drawmapscale(-119-6, 37-7.2, -119-6, 37-7.2, 500, barstyle='fancy', yoffset=20000)
    
    
# make image bigger:
plt.gcf().set_size_inches(15,15)

plt.show()
开发者ID:d80b2t,项目名称:WW4C,代码行数:32,代码来源:heatmap_earthquake_eg.py

示例7: NeighborhoodLabels

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
    neighborhoods = NeighborhoodLabels()
    for (k, v) in neighborhoods.items() :
        pos = m(v[1], v[0])
        if window_polygon.contains(Point(pos)) is True :
            ax.text(pos[0], pos[1],
            k,
            ha='center', va='center',
            size=6,
            color='black')

if radius < 2 :
    scaleLen = round(radius*4)/8*1000
else :
    scaleLen = round(radius/2)*1000

# Draw a map scale
m.drawmapscale(
    coords[0] + w * 0.2, coords[1] + h * 0.1,
    coords[0], coords[1],
    int(scaleLen),   # length in meters
    barstyle='fancy', labelstyle='simple',
    units = 'm',
    fillcolor1='w', fillcolor2='#555555',
    fontcolor='#555555',
    zorder=4)
plt.title("Parcels in Oakland with an error")
plt.tight_layout()
# this will set the image width to 722px at 100dpi
fig.set_size_inches(7.22, 5.25)  # use for larger size
plt.savefig('data/Oakland_temp.png', dpi=300, alpha=True)
plt.show()
开发者ID:TobiSzuts,项目名称:OaklandBuildHistory,代码行数:33,代码来源:DrawErrorMap.py

示例8: scale

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
    # add whatever text you would like to appear
    'This is a U.S. map showing ' + var_2_analyze + ' per state.',
    # set the horizontal/vertical alignment
    ha='right', va='bottom',
    # set the size and the color
    size=10,
    color='#555555',
    transform=ax.transAxes)

# Draw a map scale
m.drawmapscale(
    #set the coordinates where the scale should appear
    coords[0] + 0.08, coords[1] + 0.215,
    coords[0], coords[1],
    # what is the max value of the scale (here it's set to 25 for 25 miles)
    25.,
    barstyle='fancy', labelstyle='simple',
    fillcolor1='w', fillcolor2='#555555',
    fontcolor='#555555',
    zorder=5,
    # what units would you like to use. Defaults to km
    units='mi')

# set the layout to maximally fit the bounding area
plt.tight_layout()

# define the size of the figure
fig.set_size_inches(20,24)

# save the figure. Increase the dpi to increase the quality of the output .png. For example, dpi=1000 is super high quality

plt.savefig('US_' + var_2_analyze + '.png', dpi=100, alpha=True)
开发者ID:pbeiter,项目名称:Economic_potential,代码行数:34,代码来源:shapefile_map.py

示例9: plotIce

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
def plotIce(
    u,
    cmap="wiki",
    overlay=None,
    overlay2=None,
    overlay_alpha=0.3,
    overlay_alpha2=0.8,
    name="No name provided",
    units="",
    mesh_plot=False,
    meshAlpha=0.5,
    lines=False,
):
    """
               started as a fairly general tool, but has been degrated into
               something specific for Isunnguata Sermia. Will require a
               significant overhaul to make it general.
    
    Written by: Evan Cummings modified by JVJ
    
    INPUTS :
    
      u :
        FeNICS solution object to plot...must be object of type Function.
      name :
        title of the plot, latex accepted
      units :
        units for the colorbar, latex approved
      mesh_plot :
        boolean determins plotting of mesh overlay
      meshAlpha :
        alpha level of mesh 0.0 (transparent) - 1.0 (opaque)
    
    OUTPUT :
    
      A sigle 250 dpi name.png in the source directory.
    
    """
    filename = inspect.getframeinfo(inspect.currentframe()).filename
    home = os.path.dirname(os.path.abspath(filename))

    # Mesh data needed for plotting
    mesh = u.function_space().mesh()  # Pull mesh
    coord = mesh.coordinates()  # Gather coordinates

    vx = coord[:, 0]
    vy = coord[:, 1]
    fi = mesh.cells()  # These are the sets of vertices forming a triangle
    # Values corresponding to the dataset being plotted
    v = u.compute_vertex_values(mesh)

    # Set plot size:
    fig = plt.figure(figsize=(13.5, 7), dpi=80)
    ax = fig.add_axes()

    width = 236.0 * 250
    height = 90.0 * 250

    # This is the 'new' way to move x,y mesh points to lon,lat. Based on pyproj, instead of basemap.
    # It seems to work.
    p = pyproj.Proj(
        "+proj=stere +lat_0=90 +lat_ts=71 +lon_0=-46 +k=1 +x_0=0 +y_0=0 +no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000 +to_meter=1"
    )

    lon, lat = p(vx, vy, inverse=True)

    # Given original data and projection, place onto projection here that
    # 'looks' nice
    m = Basemap(
        ax=ax, width=width, height=height, resolution="h", projection="stere", lat_ts=71, lon_0=-49.67, lat_0=67.185
    )
    x, y = m(lon, lat)

    # Annotations on plot
    m.drawmeridians(np.arange(-55, -40, 0.25), color="black", labels=[False, False, False, True])
    m.drawparallels(np.arange(66, 68, 0.1), color="black")

    m.drawmapscale(-49.125, 67.097, -49.65, 67.19, 10, yoffset=0.02 * (m.ymax - m.ymin), barstyle="fancy")

    m.drawmapboundary(fill_color="white")

    # This has been a major hassle to generalize, mostly due to the colormaps
    # requiring certain asymmetry about zero, and my incistence that zero be
    # sealevel
    levels = np.arange(-3, 0.5, 0.25)

    from matplotlib import colors
    from matplotlib.ticker import ScalarFormatter

    formatter = ScalarFormatter()

    if cmap == "mby":
        cdict = gmtColormap(home + "/plothelp/mby.cpt")
        color_map = colors.LinearSegmentedColormap("color_map", cdict)
    elif cmap == "wiki":
        vmin = -550  # These are the topo extents, scaled to make 0 make sense
        vmax = 1100
        norm = colors.Normalize(vmin=vmin, vmax=vmax)
        levels = np.arange(vmin, vmax, 50)
        cdict = gmtColormap(home + "/plothelp/wiki-2.0.cpt")
#.........这里部分代码省略.........
开发者ID:JacobDowns,项目名称:VarGlaS,代码行数:103,代码来源:plotIce.py

示例10: PolygonPatch

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
cmap = plt.get_cmap('Blues')
# draw wards with grey outlines
df_map['patches'] = df_map['poly'].map(lambda x: PolygonPatch(x, ec='#555555', lw=.2, alpha=1., zorder=4))
pc = PatchCollection(df_map['patches'], match_original=True)
# impose our colour map onto the patch collection
norm = Normalize()
color_map = cmap(norm(df_map['jenks_bins'].values))
to_modify = pd.DataFrame(color_map)
to_modify.ix[df_map[df_map.postcode == 'EC1V 1'].index] = np.array([[1,1,0,1],[1,1,0,1],[1,1,0,1]])
pc.set_facecolor(np.array(to_modify))
ax.add_collection(pc)

# Add a colour bar
cb = colorbar_index(ncolors=len(jenks_labels), cmap=cmap, shrink=0.5, labels=jenks_labels)
cb.ax.tick_params(labelsize=6)

# Draw a map scale
m.drawmapscale(
    bounds_dictionary['coords'][0] + 0.08, bounds_dictionary['coords'][1] + 0.015,
    bounds_dictionary['coords'][0], bounds_dictionary['coords'][1],
    10.,
    barstyle='fancy', labelstyle='simple',
    fillcolor1='w', fillcolor2='#555555',
    fontcolor='#555555',
    zorder=5)
# this will set the image width to 722px at 100dpi
plt.tight_layout()
fig.set_size_inches(7.22, 5.25)
plt.savefig('london_parking.png', dpi=500, alpha=True)
plt.show()
开发者ID:Kali89,项目名称:london_analysis,代码行数:32,代码来源:my_plotter.py

示例11: len

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
# plot boroughs by adding the PatchCollection to the axes instance
ax.add_collection(PatchCollection(df_map['patches'].values, match_original=True))
# copyright and source data info
#smallprint = ax.text(
#    1.03, 0,
#    'Total points: %s\nContains Ordnance Survey data\n$\copyright$ Crown copyright and database right 2013\nPlaque data from http://openplaques.org' % len(ldn_points),
#    ha='right', va='bottom',
#    size=4,
#    color='#555555',
#    transform=ax.transAxes)

# Draw a map scale
m.drawmapscale(
    coords[0] + 0.08, coords[1] + 0.015,
    coords[0], coords[1],
    10.,
    barstyle='fancy', labelstyle='simple',
    fillcolor1='w', fillcolor2='#555555',
    fontcolor='#555555',
    zorder=5)
plt.title("Tax Parcels in Oakland")
plt.tight_layout()
# this will set the image width to 722px at 100dpi
fig.set_size_inches(7.22, 5.25)
plt.savefig('data/Oakland_temp.png', dpi=300, alpha=True)
plt.show()


#%% Read shape file, filter, and save a smaller size

import fiona
baseFile = 'data/Oakland_parcels/parcels'
开发者ID:TobiSzuts,项目名称:OaklandBuildHistory,代码行数:34,代码来源:Mapping2.py

示例12: plotMap

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
    def plotMap(self, maxStationDistance=None, minStationDistance=None, saveFigs=False):
        """
        Make plot of events (as beachball) and stations.
        
        Parameters
        ----------
        maxDistance : float or int
            The maximum distance from an event for stations to plot
        """
        ##Try to import basemap
        try:
            from mpl_toolkits.basemap import Basemap
        except ImportError:
            raise ImportError("mpl_toolskits does not have basemap, plotting cannot be perfromed")

        plt.figure()
        stadf, evedf = self._filterStationEvents(
            maxStationDistance=maxStationDistance, minStationDistance=minStationDistance
        )
        stadfcur = stadf[[not x for x in stadf.Proposed]]
        stadfpro = stadf[[bool(x) for x in stadf.Proposed]]
        ## set up map basics
        latmin = min([evedf.LAT.min(), stadf.LAT.min()])
        lonmin = min([evedf.LON.min(), stadf.LON.min()])
        latmax = max([evedf.LAT.max(), stadf.LAT.max()])
        lonmax = max([evedf.LON.max(), stadf.LON.max()])

        latbuff = abs((latmax - latmin) * 0.1)  # create buffers so there is a slight border with no events around map
        lonbuff = abs((lonmax - lonmin) * 0.1)
        totalxdist = (
            obspy.core.util.geodetics.gps2DistAzimuth(latmin, lonmin, latmin, lonmax)[0] / 1000.0
        )  # get the total x distance of plot in km
        # totalydist=obspy.core.util.geodetics.gps2DistAzimuth(latmin,lonmin,latmax,lonmin)[0]/1000.

        emap = Basemap(
            projection="merc",
            lat_0=np.mean([latmin, latmax]),
            lon_0=np.mean([lonmin, lonmax]),
            resolution="h",
            area_thresh=0.1,
            llcrnrlon=lonmin - lonbuff,
            llcrnrlat=latmin - latbuff,
            urcrnrlon=lonmax + lonbuff,
            urcrnrlat=latmax + latbuff,
        )
        emap.drawmapscale(lonmin, latmin, lonmin, latmin, totalxdist / 4.5)
        # emap.drawrivers()

        xmax, xmin, ymax, ymin = emap.xmax, emap.xmin, emap.ymax, emap.ymin
        # horrange=max((xmax-xmin),(ymax-ymin)) #horizontal range

        x, y = emap(stadfcur.LON.values, stadfcur.LAT.values)
        emap.plot(x, y, "^", color="k", ms=6.0)

        x, y = emap(stadfpro.LON.values, stadfpro.LAT.values)
        emap.plot(x, y, "^", color="b", ms=6.0)

        x, y = emap(evedf.LON.values, evedf.LAT.values)
        emap.plot(x, y, ".", color="r", ms=7.0)
        emap.drawstates()

        for evenum, everow in evedf.iterrows():
            x, y = emap(everow.LON, everow.LAT)
            txt = everow.NAME
            plt.annotate(txt, xy=(x, y), xycoords="data")

        latdi, londi = [
            abs(latmax - latmin),
            abs(lonmax - lonmin),
        ]  # get maximum degree distance for setting scalable ticks
        maxdeg = max(latdi, londi)
        parallels = np.arange(0.0, 80, maxdeg / 4)
        emap.drawparallels(parallels, labels=[1, 0, 0, 1], linewidth=0.0)
        meridians = np.arange(10.0, 360.0, maxdeg / 4)
        emap.drawmeridians(meridians, labels=[1, 0, 0, 1], rotation=90, linewidth=0.0)

        if saveFigs:
            plt.savefig("Map.pdf")
        else:
            plt.show()
开发者ID:SMRD,项目名称:FocPy,代码行数:82,代码来源:focpy.py

示例13: Basemap

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
m = Basemap(projection='cea',resolution='i',  llcrnrlat=44.30,urcrnrlat=60.5,\
            llcrnrlon=4.750,urcrnrlon=18.00)
m.drawcoastlines()
m.fillcontinents(color='coral',lake_color='aqua')
# draw parallels and meridians.
#m.drawparallels(np.arange(-90.,91.,5))#, labels=[True, True, True, False])
#m.drawmeridians(np.arange(-180.,181.,5))#, labels=[True, False, True, True])
m.drawmapboundary(fill_color='aqua') 
x, y=7, 51
m.drawmapscale( x, y, x, y,500,  barstyle='fancy' )
#plt.title("Equidistant Cylindrical Projection")
#plt.show()
plt.savefig('/home/s.von.hall/seminar/bspscalar.png')
开发者ID:simvh,项目名称:smi,代码行数:18,代码来源:bspscalar.py

示例14: dict

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
# Preencha os continentes. A cor é em formato hexadecimal.
mapa.fillcontinents(color='#BDA973');

# Adicione a linha de costa
mapa.drawcoastlines(linewidth=1);

# Adicine meridianos e paralenos na figura
rotulo=[1,0,0,1];
mapa.drawmeridians(range(-180,180,10),labels=rotulo);
mapa.drawparallels(range(-90,90,10),labels=rotulo);

# Adicione os rios. Neste caso, a cor será branca.
mapa.drawrivers(color='w');

# Adicione a escala.
mapa.drawmapscale(-30,-3,-20,0,200, barstyle='fancy', units='km', labelstyle='simple',fontsize=12);

# Adicione a batimetria.
bLON,bLAT,BAT = download_bathy(lnd=lonmin,lnu=lonmax,ltd=latmin,ltu=latmax)

# Salve os dados batimétricos.
BDATA = dict(LON=bLON,LAT=bLAT,BAT=BAT)
#save_pickle(BDATA,'/home/uesleisutil/Documentos/python_scripts/batimetria')

# Use a paleta de cores do cmocean
kw = dict(levels=range(-4500,0+100,100),cmap=cm.deep)
Cf = mapa.contourf(bLON,bLAT,BAT,**kw); #o **kw colocará cada um dos argumentos dentro da função
cbar = plt.colorbar(Cf);

# Adicione a batimetria.
Ct = plt.contour(bLON,bLAT,BAT,[-4000,-3000,-500,-10],colors='k')
开发者ID:uesleisutil,项目名称:python,代码行数:33,代码来源:batimetria.py

示例15: m

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import drawmapscale [as 别名]
llcrnrlat=minlatitude,urcrnrlat=maxlatitude,llcrnrlon=minlongitude,\
urcrnrlon=maxlongitude,lat_ts=45)
    
    
#m.bluemarble()
#m.etopo()
#m.shadedrelief()
m.drawcountries(linewidth=0.5)
m.drawcoastlines(linewidth=0.5)    
    
m.fillcontinents(color='#cc9955',lake_color='aqua')
m.drawmapboundary(fill_color='aqua')
#m.drawmapboundary() # draw a line around the map region

#below gives grids
m.drawparallels(np.arange(-90.,120.,5.),labels=[1,0,0,0]) # draw parallels
m.drawmeridians(np.arange(60.,190.,5.),labels=[0,0,0,1]) # draw meridians 
    
m.drawmapscale(120, -42.5, 50, 180, 1000, barstyle='fancy')

x, y = m(lons, lats)


m.plot(x, y, '^', label ="station",  markersize = 5, color = 'k')

plt.title("Plot of station pairs for all UM Gippsland seismometers")
        
lg = plt.legend()
lg.get_frame().set_facecolor('grey')

plt.show() 
开发者ID:iceseismic,项目名称:SeisSuite,代码行数:33,代码来源:plot_dataless_locs.py


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