8000 Merge pull request #20193 from anntzer/pa · matplotlib/matplotlib@22b5721 · GitHub
[go: up one dir, main page]

Skip to content

Commit 22b5721

Browse files
authored
Merge pull request #20193 from anntzer/pa
Simplify HostAxes.draw and its interaction with ParasiteAxes.
2 parents 123da17 + 3f6d932 commit 22b5721

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``ParasiteAxesBase.get_images_artists``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
... has been deprecated.

lib/mpl_toolkits/axes_grid1/parasite_axes.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def cla(self):
2424
martist.setp(self.get_children(), visible=False)
2525
self._get_lines = self._parent_axes._get_lines
2626

27+
@_api.deprecated("3.5")
2728
def get_images_artists(self):
2829
artists = []
2930
images = []
@@ -197,27 +198,20 @@ def _get_legend_handles(self, legend_handler_map=None):
197198
return all_handles
198199

199200
def draw(self, renderer):
200-
201201
orig_children_len = len(self._children)
202202

203-
if hasattr(self, "get_axes_locator"):
204-
locator = self.get_axes_locator()
205-
if locator:
206-
pos = locator(self, renderer)
207-
self.set_position(pos, which="active")
208-
self.apply_aspect(pos)
209-
else:
210-
self.apply_aspect()
203+
locator = self.get_axes_locator()
204+
if locator:
205+
pos = locator(self, renderer)
206+< 8C43 div class="diff-text-inner"> self.set_position(pos, which="active")
207+
self.apply_aspect(pos)
211208
else:
212209
self.apply_aspect()
213210

214211
rect = self.get_position()
215-
216212
for ax in self.parasites:
217213
ax.apply_aspect(rect)
218-
images, artists = ax.get_images_artists()
219-
self._children.extend(images)
220-
self._children.extend(artists)
214+
self._children.extend(ax.get_children())
221215

222216
super().draw(renderer)
223217
self._children = self._children[:orig_children_len]

0 commit comments

Comments
 (0)
0