Problem using contour(....,fmt='1.3f')

Hi all,
I'm still trying to analyse my data using the contour directive. When adding
fmt='1.3f' to the arguments, here's what happens:

In [25]:contour(r[0:zmax],z[0:zmax],rho[0:zmax],30,fmt = '1.3f')

···

---------------------------------------------------------------------------
exceptions.TypeError Traceback (most recent
call last)

/home/ngirard/.python/<console>

/usr/lib/python2.4/site-packages/matplotlib/pylab.py in contour(*args,
**kwargs)
   1784 hold(h)
   1785 try:
-> 1786 ret = gca().contour(*args, **kwargs)
   1787 draw_if_interactive()
   1788 except:

/usr/lib/python2.4/site-packages/matplotlib/axes.py in contour(self, *args,
**kwargs)
   1251
   1252 def contour(self, *args, **kwargs):
-> 1253 return self._contourHelper.contour(*args, **kwargs)
   1254 contour.__doc__ = ContourSupport.contour.__doc__
   1255

/usr/lib/python2.4/site-packages/matplotlib/contour.py in contour(self, *args,
**kwargs)
    685 col.set_linestyle((0, (6.,6.)),)
    686 #print "setting dashed"
--> 687 col.set_label(fmt%level)
    688 self.ax.add_collection(col)
    689 collections.append(col)

TypeError: not all arguments converted during string formatting

Any hint ?

Thanks in advance,
cheers,
Nicolas

Nicolas Girard wrote:

Hi all,
I'm still trying to analyse my data using the contour directive. When adding fmt='1.3f' to the arguments, here's what happens:

Nicolas: I believe that should be fmt='%1.3f'.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449
325 Broadway Web : http://www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124

Jeff,
once again, you were tight : thanks for your support !

May I suggest that the documentation for contour() contains fmt='%1.3f'
instead of fmt='1.3f' ?

cheers,
Nicolas

···

On Friday 09 September 2005 15:01, Jeff Whitaker wrote:

Nicolas: I believe that should be fmt='%1.3f'.

Nicolas Girard wrote:

···

On Friday 09 September 2005 15:01, Jeff Whitaker wrote:

Nicolas: I believe that should be fmt='%1.3f'.

Jeff,
once again, you were tight : thanks for your support !

May I suggest that the documentation for contour() contains fmt='%1.3f' instead of fmt='1.3f' ?

cheers,
Nicolas

Someone beat me to it - it already reads that way in CVS.

-Jeff

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Nope... see lib/matplotlib/contour.py, current cvs version, line 627.

Nicolas

···

On Friday 09 September 2005 16:37, Jeff Whitaker wrote:

Nicolas Girard wrote:
>May I suggest that the documentation for contour() contains fmt='%1.3f'
>instead of fmt='1.3f' ?

Someone beat me to it - it already reads that way in CVS.