On Mon, Aug 29, 2011 at 12:30 PM, Eric Firing <efiring@hawaii.edu> wrote:
On 08/29/2011 05:44 AM, Benjamin Root wrote:
> On Mon, Aug 29, 2011 at 9:59 AM, James McMurray <jamesmcm03@gmail.com
> <mailto:jamesmcm03@gmail.com>> wrote:
>     Okay, so using cm.set_over() and set_under works, but is there any
>     way of adding the set colors to the edges of the colorbar?
> This example should do what you want:
> http://matplotlib.sourceforge.net/examples/api/colorbar_only.html


Note that "extend=both" is the relevant kwarg.  With contourf, the kwarg
goes in the contourf call, and colorbar automatically gets it from the
ContourSet. With other types of color mappable plot, the kwarg needs to
be given directly to the colorbar call.


Crap! Is that why my colorbars from my pcolors (or was it pcolormesh?) never worked right?  I have been making colorbars directly for a while now because I couldn't figure out why those colorbars didn't work right.

I think I will file a feature request to fix this inconsistency.  Probably will be a bit involved to fix it, though.

Ben Root