Skip to content

Commit

Permalink
Fix constrained layout padding pre mpl v3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rcomer committed Oct 5, 2023
1 parent f615455 commit 178684c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/cartopy/tests/mpl/test_gridliner.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from shapely.geos import geos_version

import cartopy.crs as ccrs
from cartopy.mpl import _MPL_36
from cartopy.mpl.geoaxes import GeoAxes
from cartopy.mpl.gridliner import (LATITUDE_FORMATTER, LONGITUDE_FORMATTER,
Gridliner, classic_formatter,
Expand Down Expand Up @@ -497,7 +498,10 @@ def test_gridliner_title_adjust():
plt.rcParams['axes.titley'] = None

fig = plt.figure(layout='constrained')
fig.get_layout_engine().set(h_pad=1/8)
if _MPL_36:
fig.get_layout_engine().set(h_pad=1/8)
else:
fig.set_constrained_layout_pads(h_pad=1/8)
for n, proj in enumerate(projs, 1):
ax = fig.add_subplot(2, 2, n, projection=proj)
ax.coastlines()
Expand Down

0 comments on commit 178684c

Please sign in to comment.