File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515import matplotlib .pyplot as plt
1616import matplotlib .transforms as mtransforms
1717import matplotlib .figure as mfigure
18- from mpl_toolkits .axes_grid1 import parasite_axes # type: ignore
18+ from mpl_toolkits .axes_grid1 import axes_divider , parasite_axes # type: ignore
1919
2020
2121def test_simple ():
@@ -274,6 +274,7 @@ def test_unpickle_canvas():
274274
275275def test_mpl_toolkits ():
276276 ax = parasite_axes .host_axes ([0 , 0 , 1 , 1 ])
277+ axes_divider .make_axes_area_auto_adjustable (ax )
277278 assert type (pickle .loads (pickle .dumps (ax ))) == parasite_axes .HostAxes
278279
279280
Original file line number Diff line number Diff line change @@ -233,14 +233,14 @@ class _AxesDecorationsSize(_Base):
233233 }
234234
235235 def __init__ (self , ax , direction ):
236- self ._get_size = _api . check_getitem (
237- self ._get_size_map , direction = direction )
236+ _api . check_in_list ( self ._get_size_map , direction = direction )
237+ self ._direction = direction
238238 self ._ax_list = [ax ] if isinstance (ax , Axes ) else ax
239239
240240 def get_size (self , renderer ):
241241 sz = max ([
242- self ._get_size ( ax . get_tightbbox ( renderer , call_axes_locator = False ),
243- ax .bbox )
242+ self ._get_size_map [ self . _direction ](
243+ ax . get_tightbbox ( renderer , call_axes_locator = False ), ax .bbox )
244244 for ax in self ._ax_list ])
245245 dpi = renderer .points_to_pixels (72 )
246246 abs_size = sz / dpi
You can’t perform that action at this time.
0 commit comments