Search code examples
pythoncartopy

Map of extended Europe with Cartopy


The following Python code produces a good view of Western Europe:

import matplotlib.pyplot as plt
import cartopy
import cartopy.io.shapereader as shpreader
import cartopy.crs as ccrs

plt.figure(figsize=(10, 10))
ax = plt.axes(projection=ccrs.EuroPP())
ax.add_feature(cartopy.feature.BORDERS, linestyle='-', alpha=1)
ax.coastlines(resolution='10m')
ax.add_feature(cartopy.feature.OCEAN,facecolor=(0.5,0.5,0.5))
ax.gridlines()

But, what would be the way to extend the map to the East, including Turkey and other Caucasian States? Do I need to include some parameters in () of EuroPP()? Do I need to change projection=ccrs.EuroPP() for something else? Didn't find any examples...

enter image description here


Solution

  • To get the map with similar projection, Transverse Mercator with central meridian at 32 degrees longitude, try running this code:

    import cartopy
    import cartopy.crs as ccrs
    import matplotlib.pyplot as plt
    
    plt.figure(figsize=(9, 9))
    ax = plt.axes(projection=cartopy.crs.TransverseMercator(32))
    ax.add_feature(cartopy.feature.BORDERS, linestyle='-', alpha=1)
    ax.coastlines(resolution='110m')
    ax.add_feature(cartopy.feature.OCEAN, facecolor=(0.5,0.5,0.5))
    ax.gridlines()
    ax.set_extent ((-7.5, 50, 34, 69), cartopy.crs.PlateCarree())
    plt.show()
    

    You will get the plot like this:

    europe_map