I am getting started with package Cartopy for Python. I would like to display the map of Hungary with the help of package Cartopy. I'm using the following code.
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
def main():
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1, projection=ccrs.PlateCarree())
ax.set_extent([20, 10, 20, 30], crs=ccrs.PlateCarree())
ax.add_feature(cfeature.LAND)
ax.add_feature(cfeature.OCEAN)
ax.add_feature(cfeature.COASTLINE)
ax.add_feature(cfeature.BORDERS)
ax.add_feature(cfeature.LAKES, alpha=1, color="blue")
ax.add_feature(cfeature.RIVERS)
plt.show()
if __name__ == "__main__":
main()
What I don't understand is how the coordinates in ax.set_extent([5, 16, 46.5, 56]
work. These are the coordinates for Germany, I found them on the web. I've looked up the longitude/latitude for Germany, and these numbers in the code has nothing to do with them. I would be glad if somebody could explain these coordinates and give the coordinates for Hungary. Thank you.