Plot a map of France

This example show how to leverage a function to draw a map of France.


Just a map of France.

from matplotlib import pyplot as plt
from matplotlib import pyplot as plt
import as ccrs
from pyensae.datasource import load_french_departements
from pyensae.graphhelper import plot_map_france, plot_map_france_polygon

ax = plot_map_france()
# This instruction may introduce a segment fault.
# See
ax.set_extent([-5., 10., 38., 52.])


Text(0.5, 1.0, 'France')


Other function to draw departments in France.

# loads the French departments
df = load_french_departements()

fig = plt.figure(figsize=(7, 7))
ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
N = float(df.shape[0])
    ax=ax, geometry=df['geometry'],
    colors=[(i / N, 1. - i / N, 1. - i / N) for i in range(df.shape[0])])
ax.set_title('France departments')
France departments

Total running time of the script: ( 0 minutes 23.360 seconds)

Gallery generated by Sphinx-Gallery