patch for adding manual label location selection to clabel

Just because the discussion about clabel started, I want to post a short
snipplet of code that I found useful. It was some sort of hack to get a
nicer float formating for contours: contour lines represented confidence
levels of 1, 2.5, 5 and 10 per cent, and I wanted a labeling exactly as
I have written it here now. So, fmt='%.1f\%%' would have resulted in
1.0% 2.5% 5.0% ... but I wanted 1% 2.5% 5% ...

The %g format produces "nice" numbers.

For example:

  >>> print " ".join(["%g%%"%v for v in [1.0,2.5,5.000001,10.03]])
  1% 2.5% 5% 10.03%

- Paul

···

On Thu, Jul 17, 2008 at 08:50:03AM +0200, Manuel Metz wrote:

Paul Kienzle wrote:

···

On Thu, Jul 17, 2008 at 08:50:03AM +0200, Manuel Metz wrote:

Just because the discussion about clabel started, I want to post a short snipplet of code that I found useful. It was some sort of hack to get a nicer float formating for contours: contour lines represented confidence levels of 1, 2.5, 5 and 10 per cent, and I wanted a labeling exactly as I have written it here now. So, fmt='%.1f\%%' would have resulted in 1.0% 2.5% 5.0% ... but I wanted 1% 2.5% 5% ...

The %g format produces "nice" numbers.

For example:

  >>> print " ".join(["%g%%"%v for v in [1.0,2.5,5.000001,10.03]])
  1% 2.5% 5% 10.03%

- Paul

How *** **** did I miss that !? Can't believe it ...