.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
        OL,UL,P,BODY,TD,TR,TH,FORM { font-family: arial,helvetica,sans-serif;; font-size:small; color: #333333; }

        H1 { font-size: x-large; font-family: arial,helvetica,sans-serif; }
        H2 { font-size: large; font-family: arial,helvetica,sans-serif; }
        H3 { font-size: medium; font-family: arial,helvetica,sans-serif; }
        H4 { font-size: small; font-family: arial,helvetica,sans-serif; }
-->
</STYLE>
<title>ploticus: proc drawcommands</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td>
  <table cellpadding=2 width=550><tr>
  <td><br><h2>proc drawcommands</h2></td>
  <td align=right>
  <small>
  <a href="../doc/Welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  <a href="../doc/Welcome.html">Welcome</a> &nbsp; &nbsp;
  <a href="../gallery/index.html">Gallery</a> &nbsp; &nbsp;
  <a href="../doc/Contents.html">Handbook</a> 
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH proc_drawcommands PL "26-FEB-2003   PL ploticus.sourceforge.net"

.LP
.ig >>
<center><a href="../gallery/drawcom.htm">drawcom<br><img src="../gallery/drawcom.gif"></a></center>
.>>

.SH DESCRIPTION
\fBproc drawcommands\fR may be used to perform basic drawing operations
such as lines, polygons, and text, in either absolute space
or scaled space.  This may be a flexible way to add annotation, 
or to add graphics that the other plotting procedures cannot produce.
.LP
You need to provide the commands in a file, or embedded within your
ploticus script.  Or, you can use the 
.ig >>
<a href="prefab_draw.html">
.>>
\0draw prefab.
.ig >>
</a>
.>>

The commands are interpreted, and should be given one per line.
.LP
Note that proc drawcommands have nothing to do with proc getdata or the
"current data set".
.LP

.ig >>
<br><br><br>
.>>

.SH EXAMPLE
Here's an example of draw commands.
For a quick tutorial on draw commands, see the end of this page.
.nf
.ft C
\0#proc drawcommands
commands:
  color blue
  linetype 0 2 1
  mov 1 1
  lin 1 2
  lin 2 2
  lin 1 1
.ft R
.fi
.LP
A Gallery example where \fBproc drawcommands\fR is used is
.ig >>
<a href="../gallery/drawcom.htm">
.>>
\0drawcom
.ig >>
</a>
.>>

.ig >>
<br><br><br>
.>>

.SH PREREQUISITES
None.  If draw commands involving scaled space are used,
\fBproc areadef\fR must have been executed to set up a plotting area.

.ig >>
<br><br><br>
.>>

.SH MANDATORY ATTRIBUTES
Either \fCcommands\fR or \fCfile\fR containing commands (see below).


.SH ATTRIBUTES
.LP
\fBcommands\fR 
.ig >>
<a href="attributetypes.html#text">
.>>
\fI multiline-text \fR
.ig >>
</a>
.>>
.IP \0
A list of one or more draw commands.  One command per line.
Quoting is never used for string literals.
Ends with a blank line.

.LP
\fBfile\fR \fIfilename\fR
.IP \0
A file containing draw commands.  May be \fCstdin\fR to
read draw commands from standard input.

.ig >>
<a name=commandset></a>
.>>

.ig >>
<br><br><br>
.>>

.SH THE DRAW COMMAND SET
Here is a summary of the draw command set.
For an explanation of absolute units and scaled units, see
.ig >>
<a href="scaleunits.html">
.>>
scaleunits
.ig >>
</a>
<br>
<br>
<table cellpadding=2 width=500 border=1>
<tr bgcolor=FFFFEC><td>Command</td><td>Description</td></tr>
.>>
 .
.IP 
.ig >>
</td></tr><tr><td>
.>>
mov \fIx y\fR
.ig >>
</td><td>
.>>
 = move to (x,y) in absolute units


.IP 
.ig >>
</td></tr><tr><td>
.>>
lin \fIx y\fR 
.ig >>
</td><td>
.>>
= line to (x,y) in absolute units

.IP 
.ig >>
</td></tr><tr><td>
.>>
path \fIx y\fR 
.ig >>
</td><td>
.>>
= extend current polygon fill path to (x,y) in absolute units
(see also \fCfill\fR below).

.IP 
.ig >>
</td></tr><tr><td>
.>>
movs, lins, paths 
.ig >>
</td><td>
.>>
= same as above but for scaled units (assumes proc areadef
has already been used to set up a scaled space).

.IP 
.ig >>
</td></tr><tr><td>
.>>
movp, linp, pathp 
.ig >>
</td><td>
.>>
= same as above but operands may be in either
absolute space or scaled space.  If an operand ends with \fC(s)\fR
it is assumed to be in scaled space; otherwise it is assumed to
be in absolute space.

.IP 
.ig >>
</td></tr><tr><td>
.>>
text \fIs\fR 
.ig >>
</td><td>
.>>
= display text string s left adjusted at current location.  
s should not be enclosed in quotes.

.IP 
.ig >>
</td></tr><tr><td>
.>>
centext \fIs\fR 
.ig >>
</td><td>
.>>
= display text string s centered around current location
s should not be enclosed in quotes.

.IP 
.ig >>
</td></tr><tr><td>
.>>
rightjust \fIs\fR 
.ig >>
</td><td>
.>>
= display text string s right-aligned to current location
s should not be enclosed in quotes.

.IP 
.ig >>
</td></tr><tr><td>
.>>
cblock \fIx1 y1 x2 y2 color outline\fR 
.ig >>
</td><td>
.>>
= display a colored rectangle.  The
lower left is at (x1,y1) in absolute units; upper right is at (x2,y2) 
in absolute units; color is the color; outline is 1 to produce an outline, 0 not.

.IP 
.ig >>
</td></tr><tr><td>
.>>
fill 
.ig >>
</td><td>
.>>
= close and fill the polygon path with the current color.

.IP 
.ig >>
</td></tr><tr><td>
.>>
mark 
.ig >>
<a href="attributetypes.html#xy">
.>>
\0 x y 
.ig >>
</a>
.>>
sym r\fR 
.ig >>
</td><td>
.>>
= produce a symbol at (x,y).
sym is a graphcore data point symbol code as described
in 
.ig >>
<a href="symboldetails.html">
.>>
\0symboldetails.
.ig >>
</a>
.>>
r is the radius in absolute units.

.IP 
.ig >>
</td></tr><tr><td>
.>>
color \fIc\fR 
.ig >>
</td><td>
.>>
= set the current color to c

.ig >>
</td></tr><tr><td>
.>>
.IP 
textsize \fIp\fR 
.ig >>
</td><td>
.>>
= set the current text size to p points

.IP
.ig >>
</td></tr><tr><td>
.>>
linetype style width dashscale 
.ig >>
</td><td>
.>>
= set the current 
.ig >>
<a href="linedetails.html">
.>>
\0line details.
.ig >>
</a>
.>>

.IP 
.ig >>
</td></tr><tr><td>
.>>
clr 
.ig >>
</td><td>
.>>
= clear the display

.IP 
.ig >>
</td></tr><tr><td>
.>>
backcolor \fIc\fR 
.ig >>
</td><td>
.>>
= set the current background color to c

.ig >>
</table>
.>>

.ig >>
<br><br><br>
.>>
.SH HOW TO USE DRAW COMMANDS
Suppose you have an imaginary pen,
.LP
\fCcolor blue\fR sets the pen color to blue  
.br
\fCmov x1 y1\fR would move the "pen" to x1,y1 in inches from lower left corner
.br
\fClin x2 y2\fR would lower the "pen" and then draw a line to x2,y2
.br
\fClin x3 y3\fR would continue the line to x3,y3
.LP
If you don't want to use inches, you can set up a plotting area
with whatever xrange and yrange you want.  Then..
.br
\fCmovs x1 y1\fR would move the pen to x1,y1 relative to xrange and yrange   
.br
\fClins x2 y2\fR would lower the pen and then draw a line to x2,y2
.br
\fClins x3 y3\fR would continue the line to x3,y3
.LP
This is fine for drawing lines, but what about filled shapes?
To do shapes, you do the same thing as above, but use \fCpath\fR instead
of \fClin\fR, or \fCpaths\fR instead of \fClins\fR.  When you have drawn one
shape, you fill it in using:
.br
\fCfill red\fR
.LP
Then you can begin the next shape.


.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="../doc/Welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif">
</center>
</td></tr>
</table>
.>>
