''' ''' import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap from matplotlib.patches import Polygon # create the map map = Basemap(llcrnrlon=-126.5696,llcrnrlat=19.3052,urcrnrlon=-46.00888,urcrnrlat=53.53284,\ rsphere=(6378137.00,6356752.3142),resolution='l',projection='lcc',\ lat_0=43.5,lon_0=-98.,lat_1=30.,lat_2=60.) map.drawstates() map.drawcountries() map.drawcoastlines() ## load the shapefile, use the name 'states' #map.readshapefile('/air/rclare/CONDOR_OUTPUT/st99_d00', name='states', drawbounds=True) # ##print map.states_info # ## collect the state names from the shapefile attributes so we can ## look up the shape obect for a state by it's name #state_names = [] #for shape_dict in map.states_info: # state_names.append(shape_dict['NAME']) # #ax = plt.gca() # get current axes instance # ## get Texas and draw the filled polygon #seg = map.states[state_names.index('Tennessee')] #poly = Polygon(seg, facecolor='red',edgecolor='red') #ax.add_patch(poly) plt.show()