#### Description:

This function defines regions of a Plot which are to be clipped. Any subsequent graphical output created using the Plot will then be visible only within the unclipped regions of the plotting area. See also the Clip attribute.

#### Synopsis

void astClip( AstPlot ∗this, int iframe, const double lbnd[], const double ubnd[] )

#### Parameters:

##### this

Pointer to the Plot.

##### iframe

The index of the Frame within the Plot to which the clipping limits supplied in `"` lbnd`"` and `"` ubnd`"` (below) refer. Clipping may be applied to any of the coordinate systems associated with a Plot (as defined by the Frames it contains), so this index may take any value from 1 to the number of Frames in the Plot (Nframe attribute). In addition, the values AST__BASE and AST__CURRENT may be used to specify the base and current Frames respectively.

For example, a value of AST__CURRENT causes clipping to be performed in physical coordinates, while a value of AST__BASE would clip in graphical coordinates. Clipping may also be removed completely by giving a value of AST__NOFRAME. In this case any clipping bounds supplied (below) are ignored.

##### lbnd

An array with one element for each axis of the clipping Frame (identified by the index `"` iframe`"` ). This should contain the lower bound, on each axis, of the region which is to remain visible (unclipped).

##### ubnd

An array with one element for each axis of the clipping Frame (identified by the index `"` iframe`"` ). This should contain the upper bound, on each axis, of the region which is to remain visible (unclipped).

#### Notes:

- Only one clipping Frame may be active at a time. This function will deactivate any previously-established clipping Frame before setting up new clipping limits.

- The clipping produced by this function is in addition to that specified by the Clip attribute which occurs at the edges of the plotting area established when the Plot is created (see astPlot). The underlying graphics system may also impose further clipping.

- When testing a graphical position for clipping, it is first transformed into the clipping Frame. The resulting coordinate on each axis is then checked against the clipping limits (given by `"` lbnd`"` and `"` ubnd`"` ). By default, a position is clipped if any coordinate lies outside these limits. However, if a non-zero value is assigned to the Plot`’` s ClipOp attribute, then a position is only clipped if the coordinates on all axes lie outside their clipping limits.

- If the lower clipping limit exceeds the upper limit for any axis, then the sense of clipping for that axis is reversed (so that coordinate values lying between the limits are clipped instead of those lying outside the limits). To produce a `"` hole`"` in a coordinate space (that is, an internal region where nothing is plotted), you should supply all the bounds in reversed order, and set the ClipOp attribute for the Plot to a non-zero value.

- Either clipping limit may be set to the value AST__BAD, which is equivalent to setting it to infinity (or minus infinity for a lower bound) so that it is not used.

- If a graphical position results in any bad coordinate values (AST__BAD) when transformed into the clipping Frame, then it is treated (for the purposes of producing graphical output) as if it were clipped.

- When a Plot is used as a Mapping to transform points (e.g. using astTran2), any clipped output points are assigned coordinate values of AST__BAD.

- An error results if the base Frame of the Plot is not 2-dimensional.

Copyright (C) 2021 East Asian Observatory