Skip to content

Commit

Permalink
BUG: Fixes issue matplotlib#966. When appending the new axes, there i…
Browse files Browse the repository at this point in the history
…s a bug where it

does not account for the reference horizontal locator index when adding
a veritcal axes and does not accout for the reference vertical locator
index when adding a horizontal axes. This fixes that bug so that the
append_axes function adds the axes where it is expected.
  • Loading branch information
cimarronm committed Feb 4, 2014
1 parent e6f8993 commit a35fc99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/mpl_toolkits/axes_grid1/axes_divider.py
Expand Up @@ -554,10 +554,10 @@ def new_horizontal(self, size, pad=None, pack_start=False, **kwargs):
if pack_start:
self._horizontal.insert(0, size)
self._xrefindex += 1
locator = self.new_locator(nx=0, ny=0)
locator = self.new_locator(nx=0, ny=self._yrefindex)
else:
self._horizontal.append(size)
locator = self.new_locator(nx=len(self._horizontal)-1, ny=0)
locator = self.new_locator(nx=len(self._horizontal)-1, ny=self._yrefindex)

ax = self._get_new_axes(**kwargs)
ax.set_axes_locator(locator)
Expand Down Expand Up @@ -601,10 +601,10 @@ def new_vertical(self, size, pad=None, pack_start=False, **kwargs):
if pack_start:
self._vertical.insert(0, size)
self._yrefindex += 1
locator = self.new_locator(nx=0, ny=0)
locator = self.new_locator(nx=self._xrefindex, ny=0)
else:
self._vertical.append(size)
locator = self.new_locator(nx=0, ny=len(self._vertical)-1)
locator = self.new_locator(nx=self._xrefindex, ny=len(self._vertical)-1)

ax = self._get_new_axes(**kwargs)
ax.set_axes_locator(locator)
Expand Down

0 comments on commit a35fc99

Please sign in to comment.