OK, almost there, but a nudge from someone would be most appreciated.
Here is my latest plot:
Does someone have a suggestion to get my subplots to line up?
I get this with the following code:
fig = pygmt.Figure()
pygmt.config(FORMAT_GEO_MAP="ddd.x", MAP_FRAME_TYPE="plain")
if both_hemis:
tit_str = 'CICE6 {ms:s}-{vn:s}, frcg-{af:s}/{of:s}, {dt:s}'.format(af=atm_frcg,of=ocn_frcg,ms=mean_str,vn=var_name,dt=dt_str)
with fig.subplot(nrows=1, ncols=2, title=tit_str, figsize=("10c","10c")):
with fig.set_panel(panel=0):
region=[0,360,-80,-50]
projection="S0/-90/10c"
print(f'southern hemisphere nearestest neighbour for GMT regular grid requirement {(time.process_time()-c0):.3f}')
g = pygmt.nearneighbor(x=np.ravel(ice.TLON.data),
y=np.ravel(ice.TLAT.data),
z=np.ravel(ice.data),
region=region,
spacing=spacing,
search_radius=search_radius)
fig.basemap(region=region, projection=projection, frame="ag")
fig.grdimage(g,cmap=cmap)
fig.coast(land='brown')
with fig.set_panel(panel=1):
#fig.shift_origin(xshift="w+0.5c")
region=[0,360,40,90]
projection="S0/90/10c"
print(f'northern hemisphere nearestest neighbour for GMT regular grid requirement {(time.process_time()-c0):.3f}')
g = pygmt.nearneighbor(x=np.ravel(ice.TLON.data),
y=np.ravel(ice.TLAT.data),
z=np.ravel(ice.data),
region=region,
spacing=spacing,
search_radius=search_radius)
fig.basemap(region=region, projection=projection, frame="ag")
fig.grdimage(g,cmap=cmap)
fig.coast(land='brown')
fig.colorbar(frame=[f"x+l{cbar_lab}", f"y+l{cbar_units}"], position="JMR+o0.5c/0c+w8c")
else:
print(f'southern hemisphere nearestest neighbour for GMT regular grid requirement {(time.process_time()-c0):.3f}')
g = pygmt.nearneighbor(x=np.ravel(ice.TLON.data),
y=np.ravel(ice.TLAT.data),
z=np.ravel(ice.data),
region=region,
spacing=spacing,
search_radius=search_radius)
tit_str = 'tCICE6 {ms:s}-{vn:s}, frcg-{af:s}/{of:s}, {dt:s}'.format(af=atm_frcg,of=ocn_frcg,ms=mean_str,vn=var_name,dt=dt_str)
fig.basemap(region=region, projection=projection, frame=["ag", tit_str])
fig.grdimage(g,cmap=cmap)
fig.colorbar(frame="af+l{:s}".format(cbar_lab))
fig.coast(land='brown')
fig.show()
fig.savefig(F_out)
print(f'saved figure to {F_out}\n {(time.process_time()-c0):.3f}')
