Adding a further requirement to this question, I also need to have the oceans in blue (or any other colour).
For the 'PlateCarree' projection I can simply do this
crs = ccrs.PlateCarree()
crs_proj4 = crs.proj4_init
world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres"))
w = world.to_crs(crs_proj4)
g = w.plot(facecolor='sandybrown', edgecolor='black')
And now adding the ocean colour
g.set_facecolor('#A8C5DD')
If I now want to use a polar stereographic peojection
ccrs.NorthPolarStereo()
or
ccrs.SouthPolarStereo()
the projection does not work. When applying the answer to this question, I cannot get the oceans coloured
You need to plot the map geometries on Cartopy
geoaxes
, and usecartopy.feature.OCEAN
to plot the ocean. Here is the working code that you may try. Read the comments in the code for clarification.The output plot will be: