|
From: Mario M. <me...@me...> - 2010-01-20 15:18:19
|
> This works for me. > >> But >> >> cl = cb.ax.get_yticklabels() >> >> results in a list of Text objects like Text(0,0,''). > > I have no idea what's happening then. I see: > > for l in cl: > print(l) > > Text(0,0,'bla') > Text(0.166667,0.166667,'1.5') > Text(0.333333,0.333333,'3.0') > Text(0.5,0.5,'4.5') > Text(0.666667,0.666667,'6.0') > Text(0.833333,0.833333,'7.5') > Text(1,1,'9.0') > > Cheers, > Scott Has it anything to do with my matplotlib version (0.99.0) and python (2.6.4) on ubuntu karmic? following code: #------ import numpy as np from matplotlib import pyplot,mpl x = np.arange(10) y = np.arange(25) z = np.floor(10*np.random.random((25,10))) pyplot.contourf(x,y,z) cb = pyplot.colorbar() for j in cb.ax.get_yticklabels(): print(j) #---- results in: Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') That's not what i expected and makes it hard to change single ticklabels. Cheers, Mario -- Dr. Mario Mech Institute for Geophysics and Meteorology University of Cologne Zuelpicher Str. 49a 50674 Cologne Germany t: +49 (0)221 - 470 - 1776 f: +49 (0)221 - 470 - 5198 e: me...@me... w: http://www.meteo.uni-koeln.de/~mmech/ |