From: <ry...@us...> - 2010-07-02 18:45:23
|
Revision: 8486 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8486&view=rev Author: ryanmay Date: 2010-07-02 18:45:17 +0000 (Fri, 02 Jul 2010) Log Message: ----------- Allow set_ticks to take a locator object, since this is valid for the ticks kwarg in __init__. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/colorbar.py Modified: trunk/matplotlib/lib/matplotlib/colorbar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/colorbar.py 2010-07-02 18:19:08 UTC (rev 8485) +++ trunk/matplotlib/lib/matplotlib/colorbar.py 2010-07-02 18:45:17 UTC (rev 8486) @@ -299,7 +299,11 @@ set tick locations. Tick locations are updated immediately unless update_ticks is *False*. To manually update the ticks, call *update_ticks* method explicitly. """ - self.locator = ticker.FixedLocator(ticks, nbins=len(ticks)) + if cbook.iterable(ticks): + self.locator = ticker.FixedLocator(ticks, nbins=len(ticks)) + else: + self.locator = ticks + if update_ticks: self.update_ticks() @@ -842,5 +846,3 @@ cax = fig.add_axes(pbcb) cax.set_aspect(aspect, anchor=anchor, adjustable='box') return cax, kw - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |