Код: Выделить всё
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig, ax = plt.subplots(1, 1, subplot_kw={'projection': ccrs.PlateCarree()})
ax2 = fig.add_axes([0.8, 0, 0.2, 0.2], transform=ax.transAxes, projection=ccrs.PlateCarree())
Код: Выделить всё
from mpl_toolkits.axes_grid.inset_locator import inset_axes
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fig, ax = plt.subplots(1, 1, subplot_kw={'projection': ccrs.PlateCarree()})
# The following line doesn't work
ax2 = inset_axes(ax, width='20%', height='20%', axes_kwargs={'projection': ccrs.PlateCarree()})
# Doesn't work neither:
ax2 = inset_axes(ax, width='20%', height='20%', projection=ccrs.PlateCarree())
Код: Выделить всё
import matplotlib as mpl
fig, ax = plt.subplots(1, 1)
box = mpl.transforms.Bbox.from_bounds(0.8, 0.8, 0.2, 0.2)
ax2 = fig.add_axes(fig.transFigure.inverted().transform_bbox(ax.transAxes.transform_bbox(box)))
Как легко добавить sub_axes с правильным положением и размером в matplotlib и cartopy?
Насколько я понимаю, после ax.set_extend() размер осей изменится. Итак, может быть, есть способ, которым некоторая точка sub_axes (например: верхний правый угол ax2) может быть закреплена в одной фиксированной позиции родительских_осей (например: верхний правый угол ax1)?
Подробнее здесь: https://stackoverflow.com/questions/455 ... ib-and-car