Home
Up

PSTricks Part 3: Adding Lines and Arrows

Now let us connect these objects with arrows and lines. Start with with arrows. The arrow is defined with the \psline macro as

\psline{->}(1.2,4.5)(2.25,4.5)

This command indicates that we want to draw an arrow such that

The arrowhead is at the end of the line (as opposed to the beginning);
The arrow shaft should be a solid line (denoted by the single hyphen character "-" preceding the arrow head ">") Other options are available;
The drawing of the arrow should start at point (1.2,4.5). That is: 1.2 defined units of length to the right of the (0,0) origin, and 4.5 units above; and
The arrow should terminate at point (2.25,4.5).

The LaTeX input looks like:

and the result is

We fill in the remaining arrows with additional invocations of the \psline macro as

with the result

We still need to fill in lines without arrowheads and to do so, we invoke the \psline macro with a slightly different initial argument:

(Note the absence of the ">" sign, or, the "arrowhead" in the set of curly braces. The result is

 

This web site copyright © 1999-2000 by Robert A. Luke.  All rights reserved.