Subplot.twin[xy] returns a Subplot instance #1169

Merged
merged 2 commits into from Sep 2, 2012

Projects

None yet

4 participants

@leejjoon

This is to address #1165.
Not sure if there will be some regression issue as its return type is different.

@mdboom
Member
mdboom commented Aug 29, 2012

This doesn't affect any of the regression tests, but I think it would be worth noting the API change in the docs/api/api_changes.rst docs.

@pelson pelson commented on the diff Aug 30, 2012
lib/matplotlib/axes.py
@@ -7660,6 +7660,14 @@ def table(self, **kwargs):
"""
return mtable.table(self, **kwargs)
+ def _make_twin_axes(self, *kl, **kwargs):
+ """
+ make a twinx axes of self. This is used for twinx and twiny.
+ """
+ ax2 = self.figure.add_axes(self.get_position(True), *kl, **kwargs)
+ return ax2
+
+
@pelson
pelson Aug 30, 2012 Matplotlib Developers member

I know its picky, but would you mind putting 1 newline between methods and 2 newlines between top level classes/functions.

@pelson pelson commented on the diff Aug 30, 2012
lib/matplotlib/axes.py
@@ -8874,6 +8880,13 @@ def label_outer(self):
label.set_visible(firstcol)
@pelson
pelson Aug 30, 2012 Matplotlib Developers member

and here.

@pelson
Member
pelson commented Aug 30, 2012

+1 from me. Seems like a sensible solution to the problem.

@efiring efiring merged commit d8dda52 into matplotlib:master Sep 2, 2012
@efiring
Member
efiring commented Sep 2, 2012

The white-space fixes can be done later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment