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.

#!/usr/bin/env python

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()

Thanks in advance,
Mike


On Aug 24, 2006, at 7:16 PM, Michael Fitzgerald wrote:


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


---------------------------------------------------------------------- --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel? cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to