GetPlotAreaDataCoordinates

Prototype

void GetPlotAreaDataCoordinates( 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 Plot Area.

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

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

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

Plot2D plot
The plot to be interrogated.

Remarks

Imagine extending the Plot Area axes until they intersect the edges of the Plot Area. This module computes the values of each axis at the edges of the Plot Area. Call this module when you need the data coordinates of the interior of the frame around the Plot Area. For example, you may want to annotate your plots by drawing in the Plot Area margins.

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 = T( 1990:1998 );
y1 = { 6, 8, 12, 14, 21, 20, 26, 28, 32 };
y2 = 100-y1;

declare DataObject dobj;
dobj = DataObject.Create( "Market Share", {"Year" "Us" "Them"},
    x || y1 || y2 );
declare LinePlot plot;
plot = LinePlot.Create( dobj, "Year", "Them" );
plot.AddVar( "Us" );
plot.SetPlotAreaMargins( -1, 0.25, -1, -1 );

run GetPlotAreaDataCoordinates( PlotXMin, PlotXMax,
    PlotYMin, PlotYMax, plot );

plot.DrawUseDataCoordinates();
plot.DrawSetTextAlignment( ALIGN_RIGHT, ALIGN_BOTTOM );
msg = "Our increasing\nmarket share"J;
plot.DrawText( PlotXMax, y1[nrow(y1)], msg );
msg = "Market share of\nthe competition"J;
plot.DrawText( PlotXMax, y2[nrow(y2)], msg );
See Also

GetGraphAreaDataCoordinates