-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcm_1_2.py
More file actions
38 lines (27 loc) · 757 Bytes
/
cm_1_2.py
File metadata and controls
38 lines (27 loc) · 757 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
cm_1_2.py
projection vs transform
"""
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(5,3))
# the great interest with cartopy is its ability to be
# intergrated into the pyplot environnement
ax = fig.add_subplot(111, projection=ccrs.PlateCarree())
#this becomes necessary if you plot data that is not
# in the same projection
ax.set_xlim(-180,50)
ax.set_ylim(0,90)
#add coastlines
ax.coastlines()
#Point 1
UTM_X = 565718.
UTM_Y = 3980998.
ax.plot(UTM_X, UTM_Y, 'ro', transform = ccrs.UTM(11))
#Point 2
LON_X, LAT_X = (2.4, 48.8)
ax.plot(LON_X,LAT_X,'bo', transform=ccrs.Geodetic())
# plt.savefig('../../figures/OnePoint.svg',bbox_inches='tight')
plt.show()