On 2/5/07, Michael Lerner <[EMAIL PROTECTED]> wrote: > Hi, > > I have some data where I'd like almost all of it to be plotted with a > LinearSegmentedColormap that I've made, but I have a few special > values that I'd like to set to specific colors (white, in this case). > So, I made a LinearSegmentedColormap that works pretty well, but I'm > having trouble with the rest. I found a nice-looking example at > > http://www.scipy.org/Cookbook/Matplotlib/Plotting_Images_with_Special_Values > > But, it doesn't work for me. In particular, it complains a lot about > _lut. I'm using matplotlib 0.87.7 on an intel Mac running OS X and > python 2.4.
On a very quick read, it appears that the sentinel map in that example forgot to initialize the baseclass. Eg, you need class SentinelMap(Colormap): def __init__(self, cmap, sentinels={}): Colormap.__init__(self) # init the base class # boilerplate stuff - rest of init function here See if that helps, and let us know. If you get it working, please fix the wiki (you may have to sign up) and post your example along with it. Otherwise, please post a complete code example and we'll see what we can do. JDH > > Can someone show me how to make a sentinel'd version of a > LinearSegmentedColormap? > > Thank you, > > -Michael Lerner > > -- > Biophysics Graduate Student > Carlson Lab, University of Michigan > http://www.umich.edu/~mlerner http://lernerclan.net > > ------------------------------------------------------------------------- > 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