# 3.6.4.40 SetXYOffset (macro)

Computes and sets the minimum X offset (x0) and the minimum Y offset (y0). If the beginning X value or minimum Y value is less than minimumOffset*100 percent of the X (or Y) data range, then the minimum X (or Y) offset is set to zero.

## Definition:

Def  SetXYOffset {
minoffset = %1;
x0 = limit.xmin;
if (abs(x0/(limit.xmax-x0)) < minoffset)       {
x0 = 0
};
y0 = limit.ymin;
if (abs(y0/(limit.ymax-y0)) < minoffset)       {
y0 = 0
};
del -v minoffset;
#!x0 =;y0 =;
};

## Example:

The following script computes and sets the minimum X and Y offsets. If the beginning X value or minimum Y value is less than 10 percent of the X (or Y) data range, then the minimum X (or Y) offset is set to zero.

SetXYOffset 0.1;