<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Cartographie avec Python et Matplotlib
Step1:  TODO
<ASSISTANT_TASK:>
Python Code:
%matplotlib inline
Explanation: Cartographie avec Python et Matplotlib
End of explanation
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
lllat = 41.0 # latitude of lower left hand corner of the desired map domain (degrees).
urlat = 52.0 # latitude of upper right hand corner of the desired map domain (degrees).
lllon = -5.0 # longitude of lower left hand corner of the desired map domain (degrees).
urlon =  9.5 # longitude of upper right hand corner of the desired map domain (degrees).
m = Basemap(ax=ax,
            projection='stere',
            lon_0=(urlon+lllon)/2.,
            lat_0=(urlat+lllat)/2.,
            llcrnrlat=lllat,
            urcrnrlat=urlat,
            llcrnrlon=lllon,
            urcrnrlon=urlon,
            resolution='l')    # Can be ``c`` (crude), ``l`` (low), ``i`` (intermediate), ``h`` (high), ``f`` (full) or None.
m.drawcoastlines()
m.drawstates()
m.drawcountries()
#m.drawrivers()
#m.drawcounties()
# Eiffel tower's coordinates
pt_lat = 48.858223
pt_lon = 2.2921653
x, y = m(pt_lon, pt_lat)
print(pt_lat, pt_lon)
print(x, y)
m.plot(x, y, 'ro')
#plt.savefig("map.png")
plt.show()
Explanation: TODO:
- https://matplotlib.org/basemap/users/intro.html
- http://scitools.org.uk/cartopy/docs/latest/gallery.html
- https://waterprogramming.wordpress.com/2016/12/19/plotting-geographic-data-from-geojson-files-using-python/
- http://maxberggren.se/2015/08/04/basemap/
La cartographie avec basemap
Références
Python for Data Analysis de Wes McKinney, ed. O'Reilly, 2013 (p.261)
Attention
Le développement de Basemap a été stoppé et il est conseillé d'utiliser Cartopy à la place.
"Starting in 2016, Basemap came under new management. The Cartopy project will replace Basemap, but it hasn’t yet implemented all of Basemap’s features. All new software development should try to use Cartopy whenever possible, and existing software should start the process of switching over to use Cartopy. All maintenance and development efforts should be focused on Cartopy." (http://matplotlib.org/basemap/users/intro.html)
Installation
Basemap n'est pas installé par défaut avec Matplotlib.
Pour l'installer avec conda:
conda install basemap
Exemple
End of explanation
<END_TASK>