Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6378d48

Browse filesBrowse files
authored
Merge pull request #27932 from anntzer/ads
Fix pickling of make_axes_area_auto_adjustable'd axes.
2 parents 98381ab + e694329 commit 6378d48
Copy full SHA for 6378d48

File tree

Expand file treeCollapse file tree

2 files changed

+6
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-5
lines changed

‎lib/matplotlib/tests/test_pickle.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_pickle.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import matplotlib.pyplot as plt
1616
import matplotlib.transforms as mtransforms
1717
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
1919

2020

2121
def test_simple():
@@ -274,6 +274,7 @@ def test_unpickle_canvas():
274274

275275
def 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

‎lib/mpl_toolkits/axes_grid1/axes_size.py

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/axes_size.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.