tick label hiding problem

Hi all,

Sometime in the past couple months, there's been a change in SVN that's
causing me problems when trying to hide tick labels. I think the problem is
related to the get_xticklabels()/get_yticklabels() methods of the Axes class,
in that they only return a list consisting of a single tick label no matter
how many there should be. I'm encountering this problem in SVN rev. 2706.

Here is some example code:

from pylab import *
# set up a plot
x = arange(5)
ax = subplot(111)
ax.plot(x, x)
# hide the first tick label on the x axis
xtl = ax.get_xticklabels()
xtl[0].set_visible(False)
print len(xtl)
ax.set_xlabel('foo')
show()

For me, no x tick labels are drawn, and the length of xtl is one instead of
the expected 9.

Can anyone reproduce this?

Mike

Hi all,

I'm still having trouble figuring out what's going on with tick labels. I can't figure out why Axes.get_{x,y}ticklabels() is returning a list of length unity when I expect to have the list of all labels.

If I run the code below (test.py), I expect a list of 9 x tick labels. If I run the code once ('run test' in ipython), then it gives me a list of 1 tick label. If I close the interactive window it generates and run it again, it again returns 1 tick label. However, if I leave the window open and re-run the test, it gives the right answer.

Can anyone else reproduce this? Is there something I'm missing? I'm using svn rev 2730 of matplotlib, and I think this is new behavior in the last couple months.

test.py (247 Bytes)