GetGraphAreaDataCoordinates

Prototype

void GetGraphAreaDataCoordinates( Matrix XMin, Matrix XMax, Matrix YMin, Matrix YMax, Plot2D plot )

Parameters

Matrix XMin
Upon return, contains the data value of the left edge of the Graph Area.

Matrix XMax
Upon return, contains the data value of the right edge of the Graph Area.

Matrix YMin
Upon return, contains the data value of the bottom edge of the Graph Area.

Matrix YMax
Upon return, contains the data value of the top edge of the Graph Area.

Plot2D plot
The plot to be interrogated.

Remarks

Imagine extending the Plot Area axes until they intersect the edges of the Graph Area. This module computes the values of each axis at the edges of the Graph Area. Call this module when you need a coordinate system for the Graph Area that corresponds to the data coordinates in the Plot Area.

If a variable is nominal, its axis has a view range that is independent of the data. For the BarChart class, the X axis has a data range of [-1,1]. For the BoxPlot class, the X axis has a data range of [0,1]. For the MosaicPlot class, both axes have a data range of [0,1].

Example
x = { 1 2 3 4 5 6 7 8 };
y = { 1 5 4 5 9 8 10 12 };
declare LinePlot plot;
plot = LinePlot.Create( "Sample Data", x, y );
plot.ShowReferenceLines();

run GetGraphAreaDataCoordinates( GraphXMin, GraphXMax,
    GraphYMin, GraphYMax, plot );
run GetPlotAreaDataCoordinates( PlotXMin, PlotXMax,
    PlotYMin, PlotYMax, plot );

plot.DrawSetRegion( GRAPHFOREGROUND );
plot.DrawUseNormalizedCoordinates( GraphXMin, GraphXMax,
    GraphYMin, GraphYMax );
plot.DrawNumericAxis( -1, PlotYMax, 9, PlotYMax, -1, 9, 21 );
See Also

GetPlotAreaDataCoordinates
Plot.DrawUseNormalizedCoordinates