Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

@edge-python
Copy link

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

@tacaswell
Copy link
Member

I can confirm this with 1.3.x

@tacaswell
Copy link
Member

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.

@mdboom
Copy link
Member

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?

@tacaswell
Copy link
Member

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.

@mdboom
Copy link
Member

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.

@tacaswell
Copy link
Member

_make_key or _make_twin_axes?

@mdboom
Copy link
Member

mdboom commented Apr 29, 2013

Sorry, I mistyped. I meant _make_twin_axes.

@leejjoon
Copy link
Contributor

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

@edge-python
Copy link
Author

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants