Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/v1.3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Jun 24, 2013
2 parents 676be8b + efa6240 commit 7357285
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,17 @@ def _gci(self):
helper for :func:`~matplotlib.pyplot.gci`;
do not use elsewhere.
"""
# Look first for an image in the current Axes:
cax = self._axstack.current_key_axes()[1]
if cax is None:
return None
im = cax._gci()
if im is not None:
return im

# If there is no image in the current Axes, search for
# one in a previously created Axes. Whether this makes
# sense is debatable, but it is the documented behavior.
for ax in reversed(self.axes):
im = ax._gci()
if im is not None:
Expand Down

0 comments on commit 7357285

Please sign in to comment.