Eric, thanks for all of the help. Im going to do what you suggested; find a way to add a very small amount to my '0.0' values, as this should definitely place them in the 'above zero boundary' bin. Thanks again, P.Romero
---------------------------------------- > Date: Mon, 16 Mar 2009 08:58:23 -1000 > From: efir...@hawaii.edu > Subject: Re: [Matplotlib-users] FW: basemap.contourf, colormap, > extend='none', & levels array question > To: romero...@hotmail.com > CC: matplotlib-users@lists.sourceforge.net > > Pablo Romero wrote: >> Eric, >> For your reference, Im sending you a link to the python-grads interface >> files. > > Thank you. > > I am coming to the conclusion that you were mostly right early on. I > suspect that whether points landing on a contour boundary end up treated > as above or below is not uniquely defined by the algorithm, but depends > on the context. In my extremely simple examples, zero-values seem to > land in the above-zero bin, but with your array it is the opposite--at > least for the obvious large land masses. > > This brings us back to the workaround I suggested earlier; add a small > number to your points at zero to boost them up into the first bin. > > Something like this could be done within the contour code, with the > option of allowing one to specify that on-the-boundary is above, or that > it is below. I don't think I would want to do this data-fudging > automatically--partly because it would incur a speed penalty, partly > because it really is fudging--but maybe it should be added as an option. > I'm not enthusiastic about it. I would prefer to simply add a warning > to the documentation and leave the fudging to the user. > > Eric > >> >> http://downloads.sourceforge.net/opengrads/pygrads-1.1.0.tar.gz >> >> It wont function unless you have grads available, but perhaps it might help >> to take a look at how the python code is creating the GrADS masked arrays? >> >> Pablo >> >> ---------------------------------------- >>> Date: Mon, 16 Mar 2009 07:25:10 -1000 >>> From: efir...@hawaii.edu >>> Subject: Re: [Matplotlib-users] FW: basemap.contourf, colormap, >>> extend='none', & levels array question >>> To: romero...@hotmail.com >>> CC: matplotlib-users@lists.sourceforge.net >>> >>> Pablo Romero wrote: >>>> Eric, >>>> I've uploaded the file. >>>> The only thing I should mention is that my 'X' and 'Y' arrays are not >>>> masked arrays, they are 2d arrays that I created using the meshgrid >>>> function. >>>> >>>> I ended up doing this >>>> >>>> Xnp=np.array(X) >>>> Ynp=np.array(Y) >>>> >>>> which probably wasnt necessary.. >>>> >>>> Let me know if the file worked for you. >>> I got the file and I see the problem. It may take a while for me to >>> find the bug. >>> >>> Eric >> _________________________________________________________________ >> Hotmail® is up to 70% faster. Now good news travels really fast. >> http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_HM_70faster_032009 > _________________________________________________________________ Windows Live⢠Groups: Create an online spot for your favorite groups to meet. http://windowslive.com/online/groups?ocid=TXT_TAGLM_WL_groups_032009 ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users