|
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 17:06:29
|
On Wed, Jan 20, 2010 at 9:17 AM, Mario Mech <me...@me...> wrote:
> cl = cb.ax.get_yticklabels()
>
> results in a list of Text objects like Text(0,0,''). So my problem is more to get the TickLabels for vertical colorbars.
>
Can you elaborate why you need to do this?
This is a general behavior of Axes in matplotlib (i.e., not colorbar
specific). There are things that are evaluated later when the figure
gets drawn.
You may use iter_ticks method if it fits your need.
for j, p, l in cb.ax.yaxis.iter_ticks():
print l
To change the ticklabels of colorbar, they need to be set when the
colorbar is created, as Scott suggested. This is a limitation of the
current colobar implementation. Changing ticklabels (or locations)
after colorbar is created is quite tricky.
Regards,
-JJ
|