The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Unit: SDL_rchart
Class: TContourPlot
Declaration: [1] function PercentilePivots (prob: double): double;
[2] function PercentilePivots (prob: double; UseMask: boolean): double;

The function PercentilePivots returns the z value at the percentile prob of all pivot points. The valid range of prob is 0 to 100. The function comes in two overloaded variants. Version [2] allows to exclude all pivot points which are covered by the Mask array from the calculation of the percentile. This way you may restrict the calculation of the percentile to unmasked regions only.

PercentilePivots should be called only after recalculating the pivot points (CalculatePivotPoints) or after a complete redraw of the contour plot (i.e. after calling the method DrawPlot), otherwise the results may be wrong.

Hint: PercentilePivots can be used to setup the color scale of the contour plot in a way that it matches the greater part of the z values of the contour plot while ignoring outliers. For example, the following code sets the color scale in a way that the middle 96% of all z values are covered by the color scale:
  perclow   : double;
  perchigh  : double;
perclow := MyCPlot.PercentilePivots (2);
perchigh := MyCPlot.PercentilePivots (98);
MyCPlot.SetIsoParams (perclow, perchigh, (perchigh-perclow)/10);

Last Update: 2017-Sep-06