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....



SetRange


Unit: SDL_rchart
Class: TContourPlot
Declaration: procedure SetRange (xLo, yLo, xHi, yHi: extended);

The method SetRange sets the extents of the plot at once and redraws it using the new scaling. The parameters xLo, yLo, xHi, and yHi specify the ranges of the x- and the y-axis. This method is of importance for cases where the range of a contour plot should be adjusted dynamically (e.g. following the movement of a mouse) because of avoiding any unnecessary calculation of the scales.

In case of invalid parameters (e.g. negative values with logarithmic scales) SetRange is not executed at all (no exception is generated). If any of the axes has no extent (i.e. xLo = xHi, or yLo = yHi), the range of the axis is automatically set to +/-ScaleX.MinRange/2 and ScaleY.MinRange/2, respectively, of the mid value.

Example: This method is used in the following example program (see http://www.lohninger.com/examples.html for downloading the code): contplot



Last Update: 2012-Oct-20