Incorrect ylabel placement in twinx #1608

goyodiaz opened this Issue Dec 18, 2012 · 6 comments

4 participants


The ylabel of the new axes is not vertically centered and sometimes it overlaps yticklabels. This happens in recent development versions but not in 1.2.0.

This script shows the issue:

#!/usr/bin/env python

import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np

x = np.arange(100)
y1 = x
y2 = 1. / (x + 1)

plt.plot(x, y1)
plt.ylabel('Y axis #1')
plt.plot(x, y2)
plt.ylabel('Y axis #2')

This is the ouput with mpl 1.2.0 (correct):
test_1 2 0

And with 1.3.x (incorrect):
test_1 3 x

Matplotlib Developers member

I can not reproduce this with the master branch.


Thanks, tacaswell. That's weird. I'm using daily builds from (which seems in sync with master), ubuntu 12.10 quantal and python 2.7. I'll ask in the mailing list.


Looks related to #1571 . You might see if the PR in #1589 fixes it.


Thanks, dopplershift. Your PR indeed did the trick.


This seems to be fixed in master, presumably thanks to commit 8ea6241.

@goyodiaz goyodiaz closed this Jan 17, 2013
Matplotlib Developers member

@goyodiaz Thanks for following up. Glad everything is now working for you.

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