Код: Выделить всё
from matplotlib.ticker import AutoMinorLocator
fig, (ax) = plt.subplots(nrows=1, ncols=1, figsize=fig_size_single_golden, constrained_layout=True,
subplot_kw=dict(projection=ccrs.Robinson(central_longitude=-118.0))
)
cb = dia_depth_smooth.plot(
ax=ax,
robust=True,
x='geolon_t', y='geolat_t',
cmap=cm.cm.deep, vmin = 0, vmax = 2500, #norm=mcolors.SymLogNorm(linthresh=100, linscale=0.25,vmin=0.0, vmax=3000, base=10),
transform=ccrs.PlateCarree(),
shading='nearest',
cbar_kwargs={"shrink": 0.8, "aspect": 40, "pad": 0.04, "orientation":"horizontal", "label":"Diapause Depth (metres)"});
cb.colorbar.ax.yaxis.set_minor_locator(AutoMinorLocator())
#cb.colorbar.ax.invert_yaxis()
ax.coastlines(linewidth=0.5)
ax.add_feature(cartopy.feature.LAND, zorder=1, facecolor='gray', edgecolor='black', linewidth=0.5)
ax.set_title('')
#fig.tight_layout(pad=0)
plt.savefig('Figure1b.png', format='png', dpi=600, bbox_inches="tight", pad_inches=0)
ValueError: для X (361) и Y (201) с плоской штриховкой A должен иметь форму (200, 360, 3) или (200, 360, 4) или (200, 360) или (72000,), а не (263,)
Это работает, только если я использовал следующую ортогональную проекцию вместо проекции Робинсона:
Код: Выделить всё
ccrs.Orthographic