Plot.GetPlotAreaMargins

Prototypes

void GetPlotAreaMargins( Matrix mLeft, Matrix mRight, Matrix mTop, Matrix mBottom )

Parameters

Matrix mLeft
Upon return, contains the left margin of the Plot Area.

Matrix mRight
Upon return, contains the right margin of the Plot Area.

Matrix mTop
Upon return, contains the top margin of the Plot Area.

Matrix mBottom
Upon return, contains the bottom margin of the Plot Area.

Remarks

This method retrieves the plot's Plot Area margins. These margin values are in the range [0, 1] and represent fractions of the Plot Area's width or height.

The Plot Area margins determine the space between the ends of an axis and the edges of the Plot Area.

Data is not plotted in the Plot Area margins, but you can use the margins to annotate your plots.

Example
x = -5:5;
y = x##2;
declare ScatterPlot plot;
plot = ScatterPlot.Create( "Quadratic", x, y );
plot.GetPlotAreaMargins( left, right, top, bottom );
plot.GetAxisViewRange( XAXIS, xMin, xMax );
plot.GetAxisViewRange( YAXIS, yMin, yMax );

/* transform from margin coords ( [0,1] )into data coords */
plotLeft = xMin - left*(xMax-xMin)/(1-right-left);
plotRight = xMin + (1-left)*(xMax-xMin)/(1-right-left);
plotBottom = yMin - bottom*(yMax-yMin)/(1-top-bottom);
plotTop = yMin + (1-bottom)*(yMax-yMin)/(1-top-bottom);
plotCenterX = (plotLeft + plotRight)/2;
plotCenterY = (plotBottom + plotTop)/2;

/* draw rectangles in margins */
plot.DrawUseDataCoordinates();
plot.DrawRectangle( plotLeft, plotBottom, plotRight, yMin );
plot.DrawText( plotCenterX, (plotBottom+yMin)/2,
    "Bottom Plot Margin" );
plot.DrawRectangle( plotLeft, yMax, plotRight, plotTop );
plot.DrawText( plotCenterX, (yMax+plotTop)/2,
    "Top Plot Margin" );

plot.DrawSetTextAngle( 90 );
plot.DrawRectangle( plotLeft, plotBottom, xMin, plotTop );
plot.DrawText( (xMin+plotLeft)/2, plotCenterY,
    "Left Plot Margin" );
plot.DrawRectangle( xMax, plotBottom, plotRight, plotTop );
plot.DrawText( (xMax+plotRight)/2, plotCenterY,
    "Right Plot Margin" );
See Also

Plot.GetGraphAreaMargins
Plot.SetPlotAreaMargins