small fix for colorbar

Eric: I came across what may be a small bug in colorbar. If you pass a list to colorbar with the 'ticks' keyword, and the list is longer than 10, you don't actually get the ticks at the locations you specify. This patch seems to fix it:

--- colorbar.py 2007-04-09 11:12:19.000000000 -0600
+++ colorbar.py 2007-05-25 12:20:20.000000000 -0600
@@ -145,7 +145,7 @@
         self.solids = None
         self.lines = None
         if iterable(ticks):
- self.locator = ticker.FixedLocator(ticks, nbins=10)
+ self.locator = ticker.FixedLocator(ticks, nbins=len(ticks))
         else:
             self.locator = ticks # Handle default in _ticker()
         if format is None:

Notice that the Locator was being created with 10 bins, regardless of how many ticks were being asked for.

If this looks OK I can commit.

-Jeff

···

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

Jeff,

Your sensible change required one other, so I have committed both in rev 3312.

Eric

Jeff Whitaker wrote:

···

Eric: I came across what may be a small bug in colorbar. If you pass a list to colorbar with the 'ticks' keyword, and the list is longer than 10, you don't actually get the ticks at the locations you specify. This patch seems to fix it:

--- colorbar.py 2007-04-09 11:12:19.000000000 -0600
+++ colorbar.py 2007-05-25 12:20:20.000000000 -0600
@@ -145,7 +145,7 @@
        self.solids = None
        self.lines = None
        if iterable(ticks):
- self.locator = ticker.FixedLocator(ticks, nbins=10)
+ self.locator = ticker.FixedLocator(ticks, nbins=len(ticks))
        else:
            self.locator = ticks # Handle default in _ticker()
        if format is None:

Notice that the Locator was being created with 10 bins, regardless of how many ticks were being asked for.

If this looks OK I can commit.

-Jeff