-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapDisplay.py
More file actions
79 lines (76 loc) · 2.17 KB
/
MapDisplay.py
File metadata and controls
79 lines (76 loc) · 2.17 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# '''
# Created on Apr 28, 2015
#
# @author: dyr429
# '''
#
# #
# # BaseMap example by geophysique.be
# # tutorial 10
#
# import numpy as np
# import matplotlib.pyplot as plt
# from mpl_toolkits.basemap import Basemap
#
# ### PARAMETERS FOR MATPLOTLIB :
# import matplotlib as mpl
# mpl.rcParams['font.size'] = 10.
# mpl.rcParams['font.family'] = 'Comic Sans MS'
# mpl.rcParams['axes.labelsize'] = 8.
# mpl.rcParams['xtick.labelsize'] = 6.
# mpl.rcParams['ytick.labelsize'] = 6.
#
# fig = plt.figure(figsize=(11.7,8.3))
# #Custom adjust of the subplots
# plt.subplots_adjust(left=0.05,right=0.95,top=0.90,bottom=0.05,wspace=0.15,hspace=0.05)
# ax = plt.subplot(111)
# #Let's create a basemap of Europe
# x1 = -5.0
# x2 = 15.
# y1 = 45.
# y2 = 54.
#
# m = Basemap(resolution='i',projection='merc', llcrnrlat=y1,urcrnrlat=y2,llcrnrlon=x1,urcrnrlon=x2,lat_ts=(x1+x2)/2)
# m.drawcountries(linewidth=0.5)
# m.drawcoastlines(linewidth=0.5)
# m.drawparallels(np.arange(y1,y2,2.),labels=[1,0,0,0],color='black',dashes=[1,0],labelstyle='+/-',linewidth=0.2) # draw parallels
# m.drawmeridians(np.arange(x1,x2,2.),labels=[0,0,0,1],color='black',dashes=[1,0],labelstyle='+/-',linewidth=0.2) # draw meridians
#
# from matplotlib.collections import LineCollection
# from matplotlib import cm
# import shapefile
#
# r = shapefile.Reader(r"borders\bel_adm3")
# shapes = r.shapes()
# records = r.records()
#
# for record, shape in zip(records,shapes):
# lons,lats = zip(*shape.points)
# data = np.array(m(lons, lats)).T
#
# if len(shape.parts) == 1:
# segs = [data,]
# else:
# segs = []
# for i in range(1,len(shape.parts)):
# index = shape.parts[i-1]
# index2 = shape.parts[i]
# segs.append(data[index:index2])
# segs.append(data[index2:])
#
# lines = LineCollection(segs,antialiaseds=(1,))
# lines.set_facecolors(cm.jet(np.random.rand(1)))
# lines.set_edgecolors('k')
# lines.set_linewidth(0.1)
# ax.add_collection(lines)
#
# plt.savefig('tutorial10.png',dpi=300)
# plt.show()
#
#
import os
print os.path
import matplotlib.pyplot as plt
plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()