DennVer
DennVer

Reputation: 21

How to move South Pole in cartopy projection?

I'm plotting maps of Antarctica about 38 million years ago with cartopy, see this plot made with the code below. The continent, however, was then more to the southeast with respect to present day as you can see by the contours, so therefore I would like the continent to be at the center of my map (i.e., to choose a different location for the South Pole). I think I need another projection, but I don't know which one and how then to use the arguments for that projection.

output

#Defining circle for maps
theta = np.linspace(0, 2*np.pi, 100)
center, radius = [0.5, 0.5], 0.5
verts = np.vstack([np.sin(theta), np.cos(theta)]).T
circle = mpath.Path(verts*radius + center)

#Plotting
fig = plt.figure(figsize = (12,5))
ax1 = fig.add_subplot(111, projection = ccrs.Orthographic(central_longitude = 0, central_latitude = -90))
ax1.set_extent([0, 360, -90, -57], ccrs.PlateCarree())
ax1.set_boundary(circle, transform = ax1.transAxes)
MI.plot.contourf(ax = ax1, transform = ccrs.PlateCarree(), cmap = "Reds", levels = 11, cbar_kwargs = {"label": "monsoonal index [-]"})
plt.show()

Upvotes: 1

Views: 348

Answers (1)

DennVer
DennVer

Reputation: 21

Thanks to swatchai: changing the center, radius values helped:

#Defining circle for maps
theta = np.linspace(0, 2*np.pi, 100)
center, radius = [0.58, 0.44], 0.5
verts = np.vstack([np.sin(theta), np.cos(theta)]).T
circle = mpath.Path(verts*radius + center)

#Plotting
fig = plt.figure(figsize = (12,5))
ax1 = fig.add_subplot(111, projection = ccrs.Orthographic(central_longitude = 0, central_latitude = -90))
ax1.set_extent([0, 360, -90, -57], ccrs.PlateCarree())
ax1.set_boundary(circle, transform = ax1.transAxes)
MI.plot.contourf(ax = ax1, transform = ccrs.PlateCarree(), cmap = "Reds", levels = 11, cbar_kwargs = {"label": "monsoonal index [-]"})
plt.show()

This results in the plot:

outputplot

Upvotes: 1

Related Questions