[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4. Drawing commands
All of Asymptote
's graphical capabilities are based on four primitive
commands. The three PostScript
drawing commands draw
,
fill
, and clip
add objects to a picture in the order in
which they are executed, with the most recently drawn object appearing on top.
The labeling command label
can be used to add text
labels and external EPS images, which will appear on top of the
PostScript
objects (since this is normally what one wants), but
again in the relative order in which they were executed. After drawing
objects on a picture, the picture can be output with the
shipout
function (see shipout).
If you wish to draw PostScript
objects on top of labels (or verbatim
tex
commands; see tex), the layer
command may be
used to start a
new PostScript/LaTeX
layer:
void layer(picture pic=currentpicture);
The layer
function gives one full control over the order in which
objects are drawn. Layers are drawn sequentially, with the most recent
layer appearing on top. Within each layer, labels, images, and
verbatim tex
commands are always drawn after the
PostScript
objects in that layer.
While some of these drawing commands take many options, they all have sensible default values (for example, the picture argument defaults to currentpicture).
4.1 draw | Draw a path on a picture or frame | |
4.2 fill | Fill a cyclic path on a picture or frame | |
4.3 clip | Clip a picture or frame to a cyclic path | |
4.4 label | Label a point on a picture |