|
From: Eric F. <ef...@ha...> - 2010-01-22 02:25:01
|
Jae-Joon Lee wrote: > On Wed, Jan 20, 2010 at 2:04 PM, Eric Firing <ef...@ha...> wrote: >> The reason for this fudge in contour is that contourf fills >> lower < z <= upper >> for each consecutive pair of contour levels. >> When the minimum value of z coincides with the lowest level, then regions >> with that minimum are left blank; so the lowest level is adjusted downward >> slightly, making the lowest contour interval include the minimum value. >> > > I understand levels can be adjusted for a better contouring, but I'm > not sure whether this change needs to be visible to users. > > The autoleveler, initially creates following levels > > [0, 1.5, 3, 4.5, 6, 7.5, 9.] > > But due to the reason you described above, they become > > array([ -9.00000000e-06, 1.50000000e+00, 3.00000000e+00, > 4.50000000e+00, 6.00000000e+00, 7.50000000e+00, > 9.00000900e+00]) > > And the colorbar uses the adjusted levels for labeling. But I think it > may make more sense to use the initial levels (at least for the > colorbar ticks). JJ, I changed my mind and decided you are correct in thinking the change should be made in contour.py. I now make the bottom boundary adjustment at the last possible time, and in such a way that it does not change the levels array at all. Therefore the colorbar never sees it, and the result of explicitly supplying a set of levels is identical to the case where those levels result from autoscaling. Eric > > Regards, > > -JJ |