Skip to content

Commit

Permalink
axes_grid1: make HostAxes.twinx and twiny more compatible with origin…
Browse files Browse the repository at this point in the history
…al mpl's axes. Closes matplotlib#594
  • Loading branch information
leejjoon committed Dec 28, 2011
1 parent 7cbc446 commit 56c299a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/mpl_toolkits/axes_grid1/mpl_axes.py
Expand Up @@ -132,11 +132,11 @@ def toggle(self, all=None, ticks=None, ticklabels=None, label=None):
labelOn = "label%dOn" % self._axisnum

if _ticks is not None:
for tick in self._axis.get_major_ticks():
setattr(tick, tickOn, _ticks)
tickparam = {tickOn: _ticks}
self._axis.set_tick_params(**tickparam)
if _ticklabels is not None:
for tick in self._axis.get_major_ticks():
setattr(tick, labelOn, _ticklabels)
tickparam = {labelOn: _ticklabels}
self._axis.set_tick_params(**tickparam)

if _label is not None:
pos = self._axis.get_label_position()
Expand Down
8 changes: 4 additions & 4 deletions lib/mpl_toolkits/axes_grid1/parasite_axes.py
Expand Up @@ -324,14 +324,14 @@ def twinx(self, axes_class=None):
# for normal axes

self.axis["right"].toggle(all=False)
self.axis["right"].line.set_visible(False)
self.axis["right"].line.set_visible(True)

ax2.axis["right"].set_visible(True)
ax2.axis["left","top", "bottom"].toggle(all=False)
ax2.axis["left","top", "bottom"].line.set_visible(False)

ax2.axis["right"].toggle(all=True)
ax2.axis["right"].line.set_visible(True)
ax2.axis["right"].line.set_visible(False)

return ax2

Expand All @@ -356,14 +356,14 @@ def twiny(self, axes_class=None):
self.parasites.append(ax2)

self.axis["top"].toggle(all=False)
self.axis["top"].line.set_visible(False)
self.axis["top"].line.set_visible(True)

ax2.axis["top"].set_visible(True)
ax2.axis["left","right", "bottom"].toggle(all=False)
ax2.axis["left","right", "bottom"].line.set_visible(False)

ax2.axis["top"].toggle(all=True)
ax2.axis["top"].line.set_visible(True)
ax2.axis["top"].line.set_visible(False)

return ax2

Expand Down

0 comments on commit 56c299a

Please sign in to comment.