-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.py
40 lines (26 loc) · 755 Bytes
/
Map.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 16 14:40:13 2016
@author: Jinzhen
"""
matplotlib
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
def mapTut():
m = Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,\
llcrnrlon=-130,urcrnrlon=-60,resolution='c')
m.drawcoastlines()
m.drawcountries()
m.drawstates()
m.fillcontinents(color='#04BAE3',lake_color='#FFFFFF')
m.drawmapboundary(fill_color='#FFFFFF')
# Houston, Texas
lat,lon = 29.7630556,-95.3630556
x,y = m(lon,lat)
m.plot(x,y, 'ro')
lon, lat = -104.237, 40.125 # Location of Boulder
xpt,ypt = m(lon,lat)
m.plot(xpt,ypt, 'go')
plt.title("Geo Plotting")
plt.show()
mapTut()