matplotlib 1.2 / pylab_examples example code: multiple_yaxis_with_spines.py #1957

Closed
edge-python opened this Issue Apr 28, 2013 · 9 comments

Comments

Projects
None yet
4 participants

Hallo,

the pylab_examples example code: multiple_yaxis_with_spines.py

works incorrect with matplotlib 1.2

(with matplotlib 1.1.0 o.k.)

please check it

Thank you

(i use python 2.7.4)

with matplotlib 1.2
matplotlib 1-2 multiple_yaxis_with_spines

with matplotlib 1.1
matplotlib 1-1 multiple_yaxis_with_spines

.
.
and this is the result in my program
.
with matplotlib 1.2
matplotlib 1-2 TA

with matplotlib 1.1
matplotlib 1-1 TA

Owner

tacaswell commented Apr 29, 2013

I can confirm this with 1.3.x

Owner

tacaswell commented Apr 29, 2013

The issue seems to be that repeated calls to host.twinx() returns the same object, which looks like a feature of figure.add_axes which it uses underneath.

Owner

mdboom commented Apr 29, 2013

@tacaswell: Thanks for tracking that down. git bisect also tells me that the first bad commit is 687a6ef. @leejjoon: Any thoughts?

Owner

tacaswell commented Apr 29, 2013

I also hit that commit just by looking at blame, and grew confused.

It looks like it should have never worked, and the fact that it was working in 1.1 is the bug. I would guess it is related to the _make_key code, which does not sort the keys in kwargs before turning them into a tuple, and the extra layer of making the function call.

Owner

mdboom commented Apr 29, 2013

If I comment out the second _make_twin_axes function, (the one in SubplotBase, not the one in Axes) then it works for me -- I haven't run the test suite to see what that breaks, though.

EDIT: Corrected _make_key to _make_twin_axes.

Owner

tacaswell commented Apr 29, 2013

_make_key or _make_twin_axes?

Owner

mdboom commented Apr 29, 2013

Sorry, I mistyped. I meant _make_twin_axes.

Contributor

leejjoon commented Apr 29, 2013

The commit was part of #1169. So, I guess it is better to fix the method rather than remove it.

leejjoon added a commit to leejjoon/matplotlib that referenced this issue Apr 30, 2013

mdboom added a commit to mdboom/matplotlib that referenced this issue May 3, 2013

mdboom added a commit to mdboom/matplotlib that referenced this issue May 3, 2013

@leejjoon leejjoon closed this in 377facb May 3, 2013

Hallo,

thank you for fix the problem.

With the new code in axes.py matplotlib 1.21 my program works well !

edge-python

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