You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to make a polar view of CESM output on the ne30 grid (nominal 1 degree resolution). I found this MPAS example helpful. Thank you!
With this relatively coarse resolution, I can only get reasonable looking plots by reducing pixel_ratio so the points look larger. It also seems this could be addressed if method = trimesh or polygon were enabled, but it seems like this is currently not supported? Is this something that's coming? or is there another way to customize plots besides using the rasterize function?
My code is below if you're on derecho and interested in replicating
# Read in data
mesh = '/glade/campaign/cesm/cesmdata/inputdata/share/meshes/ne30pg3_ESMFmesh_cdf5_c20211018.nc'
fin = '/glade/derecho/scratch/wwieder/ADF/b.e23_alpha17f.BLT1850.ne30_t232.093/climo/b.e23_alpha17f.BLT1850.ne30_t232.093_TSA_climo.nc'
ds = ux.open_dataset(mesh, fin)
# Set up some features and the projection
def features(projection):
return gf.coastline(projection=projection, linewidth=1, scale="50m") * gf.states(
projection=projection, linewidth=1, scale="50m"
)
projection = ccrs.Orthographic(central_latitude=90)
# Make the plot
ds.TSA.mean('time').plot.rasterize(
method="point",
projection=projection,
cmap="RdBu_r",
backend="matplotlib",
pixel_ratio=0.3,
fig_size=250,
) * features(projection)
We haven't added projection support for polygons directly with our plotting API yet. I'd suggest using our Matplotlib routines for now until we add direct support.
Activity
philipc2 commentedon Aug 28, 2024
Hi @wwieder
We haven't added projection support for polygons directly with our plotting API yet. I'd suggest using our Matplotlib routines for now until we add direct support.
https://uxarray--917.org.readthedocs.build/en/917/user-guide/mpl.html#geographic-projections-elements
Let me know if this works out for you.