Here is the explanation for the preceding code:
- ax.coastlines(zorder=0) plots coastlines on the map as follows:
- zorder=0 specifies that the coastlines should be plotted first, so that they don't come into the foreground and obscure the time zone lines
- shape_feature = ShapelyFeature(Reader('ne_10m_time_zones.shp').geometries(),ccrs.PlateCarree(), edgecolor='black') creates a feature object that can be added to the map:
- Reader extracts the contents from the shapefile as we have been doing so far
- ShapelyFeature prepares the contents as a feature that can be added to the map using the add_feature method
- ax.add_feature(shape_feature, alpha=0.4, zorder=5, lw=1) adds the feature, created in the previous step, to the map: ...