On Wed, Jan 20, 2010 at 12:12 PM, Mario Mech <m...@meteo.uni-koeln.de> wrote:
> the smallest value (0.0) is labeled with "-0.0". I just want to get rid of 
> the minus sign.
>

This is because the actual value is "-9.00000000e-06" (this inherits
from the levels of contour).
While I think we're fixing a wrong problem (the contour routine need
to be fixed in my view), here is a workaround you may use.

-JJ

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

cntr = pyplot.contourf(x,y,z)

cb = pyplot.colorbar(format=r"%2.1f")


ticklabel_seq = cb.ax.yaxis.major.formatter.seq
try:
    indx = ticklabel_seq.index("-0.0")
    ticklabel_seq[indx]="0.0"
except ValueError:
    pass


pyplot.show()

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