Heatmap interpolation color

Jan 16, 2014 at 11:43 AM
Edited May 15, 2014 at 7:05 AM
When I create a heatmap with say +10 is red, 0 is green and -10 is blue, the interpolated color of two adjacent cells of +10 and -10 is not green (0). I expect that the color between these two cells is green! Or is there a setting to change this behaviour?
Coordinator
Jan 17, 2014 at 7:59 AM
Interesting :) I think this is a bug when Interpolate = true.
The heat map is rendered by interpolating a bitmap, and this is not the same as the interpolation of the palette.
At the center of each pixel it will be correct, but between pixels may be wrong.

It can be reproduced by
        [Example("D501409: Interpolation Issue")]
        public static PlotModel InterpolationIssue()
        {
            var data = new double[2, 3];
            data[0, 0] = -10;
            data[0, 1] = 10;

            var model = new PlotModel("HeatMapSeries");
            model.Axes.Add(new LinearColorAxis { Position = AxisPosition.Right, Palette = new OxyPalette(OxyColors.Red, OxyColors.Green, OxyColors.Blue) });

            var hms = new HeatMapSeries
            {
                CoordinateDefinition = HeatMapCoordinateDefinition.Edge,
                X0 = 0,
                X1 = 2,
                Y0 = 0,
                Y1 = 3,
                Data = data,
                Interpolate = true,
                LabelFontSize = 0.2
            };
            model.Series.Add(hms);
            return model;
        }
Does anyone know how this can be fixed?
May 15, 2014 at 7:07 AM
Someone found a solution for this 'bug'?