File tree 2 files changed +6
-5
lines changed 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 15
15
import matplotlib .pyplot as plt
16
16
import matplotlib .transforms as mtransforms
17
17
import 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
19
19
20
20
21
21
def test_simple ():
@@ -274,6 +274,7 @@ def test_unpickle_canvas():
274
274
275
275
def test_mpl_toolkits ():
276
276
ax = parasite_axes .host_axes ([0 , 0 , 1 , 1 ])
277
+ axes_divider .make_axes_area_auto_adjustable (ax )
277
278
assert type (pickle .loads (pickle .dumps (ax ))) == parasite_axes .HostAxes
278
279
279
280
Original file line number Diff line number Diff line change @@ -233,14 +233,14 @@ class _AxesDecorationsSize(_Base):
233
233
}
234
234
235
235
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
238
238
self ._ax_list = [ax ] if isinstance (ax , Axes ) else ax
239
239
240
240
def get_size (self , renderer ):
241
241
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 )
244
244
for ax in self ._ax_list ])
245
245
dpi = renderer .points_to_pixels (72 )
246
246
abs_size = sz / dpi
You can’t perform that action at this time.
0 commit comments