- 
                Notifications
    
You must be signed in to change notification settings  - Fork 391
 
Open
Description
I want to build a cartopy feature for Antartica in palaeo geography. I have the lon/lat of the coastline.
I can't find a way to have a nice plot in any projection.
Here is an example that plots a simple circle (filled) around the south pole. It gives an ugly result in some projection.
Is there a trick to make this work ? How was build the LAND feature to produce such plots ?
Thanks for any idea
Olivier
import numpy as np
import matplotlib.pyplot as plt, matplotlib as mpl
import cartopy.crs as ccrs, cartopy
import shapely as shp
# Defines a circle around Antartica
nn = 20
lon_coast = np.linspace (start=-180, stop=180, num=nn)
lat_coast = np.ones (nn)*(-70)
coord_coast = np.stack ( [lon_coast, lat_coast] ).T
<img width="950" height="562" alt="Image" src="https://github.com/user-attachments/assets/c522e187-e665-4574-9a4b-206dccfeef7d" />
coord_coast = np.vstack ( [coord_coast, np.array([np.nan, np.nan])])
# Build the cartopy feature for the circle
coast_shp  = shp.Polygon (coord_coast)
coast_feat = cartopy.feature.ShapelyFeature (coast_shp, ccrs.PlateCarree (central_longitude=0), facecolor='green')
# Plot the circle with various projections
fig = plt.figure(figsize=(12,8) )
def my_fig (idx, proj) :
    pos=230+idx
    ax = fig.add_subplot (pos, projection=proj)
    ax.add_feature (coast_feat, facecolor='green', edgecolor='red')
    ax.coastlines ()
    ax.gridlines  ()
my_fig (1, ccrs.PlateCarree  ())
my_fig (2, ccrs.Orthographic (central_latitude=-90))
my_fig (3, ccrs.PlateCarree  (central_longitude=180))
my_fig (4, ccrs.Robinson     (central_longitude=0))
my_fig (5, ccrs.Robinson     (central_longitude=0))
Metadata
Metadata
Assignees
Labels
No labels