Under review
Heatmap interpolation color
This discussion was imported from CodePlex
AvanDiepen wrote at 2014-01-16 11:43:
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?
objo wrote at 2014-01-17 07:59:
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
Does anyone know how this can be fixed?
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; }
AvanDiepen wrote at 2014-05-15 08:07:
Someone found a solution for this 'bug'?
Customer support service by UserEcho
I have (of course) the same issue.
In my opinion, the only way to correct this is to modify the source code (eventually by adding an "InterpolationMode" enum if you want to keep the bitmap interpolation mode (but it really seems wrong to me)).
Is this planned ?
Olivier
It certainly is not optimal, but it should work
.
Olivier