From: Benjamin R. <ben...@ou...> - 2010-10-02 16:23:58
|
On Fri, Oct 1, 2010 at 8:59 PM, Stan West <sta...@nr...> wrote: > Hi, developers. I stumbled upon this when I noticed that gist_stern_r > isn't the reverse of gist_stern. As the attached script shows, the > discontinuity in red is wrong, and green stays zero instead of ramping. The > problem seems to be that when cm.revcmap() reverses a linear segment map > spec (such as {'red': [(0, 0, 0), (0.5, 1, 1), (1, 1, 1)], ...}), it doesn't > swap the second and third elements of each tuple—the color values facing in > each direction. That makes no difference for continuous colormaps but > distorts discontinuous maps such as gist_stern. I believe that the attached > "cm.patch" file fixes the problem. > > The other patch, "_cm.patch", is only aesthetic after the above patch is > applied. It changes an element of the gist_stern colormap spec that should > have been unused but which caused the green channel to stay at zero with the > old revcmap. With the patched revcmap, the changed element should not be > used, but the colormap spec will look like most others with the second and > third elements of the tuple being equal. > > I can confirm the bug, but I have not tested the patch. Ben Root |