Here is the explanation for the preceding code:
- shp_fl = shpreader.natural_earth(resolution='10m', category='cultural', name='populated_places') downloads the shapefile containing the information of locations that are populated by human beings
- xy = [pt.coords[0] for pt in shpreader.Reader(shp_fl).geometries()] extracts the coordinates of locations into the xy variable
- x, y = zip(*xy) unzips coordinates into x and y coordinates
- ax.scatter(x,y, transform=ccrs.Geodetic()) draws a scatter plot of the locations
- ax.set_title('Populated places of the world.') sets the title for the plot
Upon executing the preceding code, you should see the following map on your screen. Blue dots represent locations where human beings are present: ...