> Can you elaborate why you need to do this?

As you can see in my example:

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

pyplot.show()
#------

the smallest value (0.0) is labeled with "-0.0". I just want to get rid of the 
minus sign.

Cheers

Mario

> 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


-- 
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: m...@meteo.uni-koeln.de
w: http://www.meteo.uni-koeln.de/~mmech/

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to