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


Python Basemap.show方法代码示例

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


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

示例1: __init__

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import show [as 别名]
class MapDrawer:
    
    mymap = None;
    projection = 'hammer';
    
    def __init__(self, projection = 'hammer', lon_0 = 0, resolution = 'c'):
        self.mymap = Basemap(projection, lon_0, resolution);
        self.mymap.bluemarble()
    
    def show_map(self):
        self.mymap.show();
        
    def draw_markers(self, lats, longs, title = '', clever_mode = 0):
        
        # draw parallels and meridians.
        lats = np.array(lats)
        longs = np.array(longs)
        if clever_mode:
            print "Clever mode is under construction" 
        xpt,ypt = self.mymap(longs,lats)
        print xpt;
        self.mymap.plot(xpt, ypt, 'ro')
        if title:
            plt.title('Tweets about ' + title) 
            plt.show()        
        
        #mymap = Basemap(projection = 'hammer', lon_0 = 0, resolution = 'c');
        #xpt,ypt = mymap(longs,lats)
        #mymap.plot(xpt, ypt, 'ro')
开发者ID:bjarte1990,项目名称:twAnalytic,代码行数:31,代码来源:mapdrawer.py

示例2: basemapPGAPlot

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import show [as 别名]
def basemapPGAPlot(lons, lats, pga):
        
    lonmesh, latmesh = np.meshgrid(lons, lats)
    pga = np.array(pga)
    pga = pga.reshape((len(lons), len(lats)))
    
    
    plt.close()
    m = Basemap(projection='cyl', llcrnrlat=lats.min(), urcrnrlat=lats.max(), llcrnrlon=lons.min(), urcrnrlon=lons.max(), resolution='i')
    m.drawcoastlines()
    
    #m.drawmapboundary(fill_color='PaleTurquoise')
    #m.fillcontinents(color='lemonchiffon',lake_color='PaleTurquoise', zorder=0)
    m.drawmapboundary()#fill_color='lightgray')
    #m.fillcontinents(color='darkgray',lake_color='lightgray', zorder=0)
    m.drawcountries()
    
    m.drawparallels(np.arange(round(lats.min()),round(lats.max()),2), labels=[1,0,0,0])
    m.drawmeridians(np.arange(round(lons.min()),round(lons.max()),2), labels=[0,0,0,1])
    
    #m.contourf(lonmesh, latmesh, pga)
    #m.plot(simx[::], simy[::], 'm.')
    m.pcolormesh(lonmesh, latmesh, pga, vmin = 0, vmax = 20, cmap="jet")
    cb = m.colorbar()
    cb.set_label("Peak Ground Acceleration (% g)")
    m.show()
开发者ID:johnmaxwilson,项目名称:GMPE-x-ETAS,代码行数:28,代码来源:Shakemap_reader.py

示例3: range

# 需要导入模块: from mpl_toolkits.basemap import Basemap [as 别名]
# 或者: from mpl_toolkits.basemap.Basemap import show [as 别名]
['NY',42.1497,-74.9384],
['OH',40.3736,-82.7755],
['OK',35.5376,-96.9247],
['OR',44.5672,-122.1269],
['PA',40.5773,-77.2640],
['RI',41.6772,-71.5101],
['SC',33.8191,-80.9066],
['SD',44.2853,-99.4632],
['TN',35.7449,-86.7489],
['TX',31.1060,-97.6475],
['UT',40.1135,-111.8535],
['VA',37.7680,-78.2057],
['VT',44.0407,-72.7093],
['WA',47.3917,-121.5708],
['WI',44.2563,-89.6385],
['WV',38.4680,-80.9696],
['WY',42.7475,-107.2085]]

for i in range(len(state2LatLong)):
    # Get the x,y coordinate for the geoplot. Note: It's Long / Lat.
    x, y = geoMap(state2LatLong[i][2],state2LatLong[i][1])
    geoMap.plot(x,y,'ro')
    geoMap.text(x+10000,y+10000,state2LatLong[i][0], bbox=dict(facecolor='yellow',alpha=0.5))
    

# Adjust size of image
geoMap.gcf().set_size_inches(12.0,8.0)
# Add Title and show.
geoMap.title("US Map with Labels")
geoMap.show()
开发者ID:Aayrl,项目名称:python_DataScience,代码行数:32,代码来源:geo_USMapLabeled.py


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