Phil, Jim, Thanks. I need to add a suitable example for the contourf case, because as you have discovered it is a little different from all the other mappable cases: colorbar takes its cue from the contourf arguments so as to be consistent with the way the contourf plot was made. There is a line in the colorbar docstring indicating this, although I don't recall when I put that line in, so it may not be in the version you are using:
If mappable is a ContourSet, its extend kwarg is included automatically. Eric Philip Austin wrote: > James Boyle writes: > > Thanks, Eric > > > > to > > > > im = contourf(Zm,cmap=palette) > > > > I do not get the over/under pointers on the end of the colorbar. > > > > Does this feature not work with contourf - Or am I doing something > > wrong. > > Here's a code segment that works for me: > > vmin,vmax=(280,305) > norm = colors.normalize(vmin = vmin, vmax = vmax, clip = True) > cmap=matplotlib.cm.jet > cmap.set_over('salmon', 1.0) > cmap.set_under('black', 0.25) > contplot = axes.contourf(pv.time_value, > pv.pressure_value, > pv.var1_value, > n.arange(vmin,vmax,2.), > norm=norm, > extend='both', > cmap=cmap) > > > I got the hint on this from the contourf docstring > > ***** New: ***** > * extend = 'neither', 'both', 'min', 'max' > Unless this is 'neither' (default), contour levels are > automatically added to one or both ends of the range so that > all data are included. These added ranges are then > mapped to the special colormap values which default to > the ends of the colormap range, but can be set via > Colormap.set_under() and Colormap.set_over() methods. > To replace clip_ends=True and V = [-100, 2, 1, 0, 1, 2, 100], > use extend='both' and V = [2, 1, 0, 1, 2]. > > > regards, Phil > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users