|
From: Daniel H. <dh...@gm...> - 2011-02-20 16:18:02
|
The function "clabel" does not allow the use of formatters for the label;
this small patch enables their use, so that one can pass in any subclass of
ticker.Formatter in the 'fmt' argument.
Replace the following in contour.py:
def get_text(self, lev, fmt):
"get the text of the label"
if cbook.is_string_like(lev):
return lev
else:
if isinstance(fmt,dict):
return fmt[lev]
else:
return fmt%lev
With the following:
def get_text(self, lev, fmt):
"get the text of the label"
if cbook.is_string_like(lev):
return lev
else:
if isinstance(fmt,dict):
return fmt[lev]
elif isinstance(fmt,ticker.Formatter):
return fmt(lev)
else:
return fmt%lev
As you can see, there is only a two line change, but it does enable
formatters. Perhaps one of the devs can put this in?
--
Daniel Hyams
dh...@gm...
|