Index: ../trunk-jpl/src/m/plot/webgl.js =================================================================== --- ../trunk-jpl/src/m/plot/webgl.js (revision 19807) +++ ../trunk-jpl/src/m/plot/webgl.js (revision 19808) @@ -116,11 +116,15 @@ return modelMatrix; } //}}} function rgb(value, min, max) { //{{{ + + var normalizedValue; colorbar=colorbars["rainbow"]; value = clamp(value, min, max); - var normalizedValue = (value - min) / (max - min); + if((max-min)!=0) normalizedValue = (value - min) / (max - min); + else normalizedValue = value; + var index = clamp(Math.round(normalizedValue * colorbar.length), 0, colorbar.length - 1); return colorbar[index]; } //}}}