1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
<H2>DESCRIPTION</H2>
<EM>d.graph</EM>
draws graphics that are described either from standard input (default),
or within a file (if an input <EM>file</EM> name is identified on the
command line). If graphics commands are entered from standard input,
a <EM>CTRL-d</EM> is used to signal the end of input to <EM>d.graph</EM>.
<P>
The program can be run interactively or non-interactively.
The user can run the program completely non-interactively
by specifying the name of a graphics <EM>file</EM> containing
<EM>d.graph</EM>
graphics commands and the values of all needed parameters on the command line.
The user can instead elect to run the program partially interactively,
by specifying any/all of the parameters <EM>except</EM>
the graphics <B>file=</B><EM>name</EM> parameter on the command line.
In this case, <EM>d.graph</EM> will expect the user to input <EM>d.graph</EM>
graphics commands from standard input (i.e., the keyboard) and
will (silently) prompt the user for these graphics commands.
<P>
Alternately, the user can simply type <B>d.graph</B> on the command line,
and be prompted for the values of all parameters (the user can still
input graphics commands from either an input file or standard input
using this form). In this case, the user is presented with the standard
GRASS <EM><A HREF="parser.html">parser</A></EM> interface.
<P>
The coordinate system used is 0-100 in x and 0-100 in y,
regardless of the graphics monitor display frame size and aspect.
The (0,0) location is the lower left corner of the active graphics
monitor display frame. All values may be floating point.
<P>
The graphics language is simple, and uses the following commands:
<DL>
<DT><B>#</B> <EM>comment</EM>
<DD>A line of comment which is ignored in the processing.
<DT><B>move</B> <EM>xpos</EM> ypos</B>
<DD>The current location is updated to <EM>xpos ypos</B>.
Values are stated as a percent of the active display frame's
horizontal (<EM>xpos</EM>) and vertical (<EM>ypos</EM>) size,
and may be floating point values. Values are between 0-100.
<B>Note.</B> A space must separate <EM>xpos</EM> and <EM>ypos</EM>.
<DT><B>draw</B> <EM>xpos</EM> ypos</B>
<DD>A line is drawn in the current color from the current location to the new
location <EM>xpos</EM> ypos</B>, which then becomes the current location.
Values are stated as a percent of the active display frame's
horizontal (<EM>xpos</B>) and vertical (<EM>ypos</B>) size,
and may be floating point values. Values are between 0-100.
<B>Note.</B> A space must separate <EM>xpos</EM> and <EM>ypos</B>.</EM>
<DT><B>color</B> <EM>color</EM>
<DD>Sets the current color to that stated; subsequent graphics will be drawn
in the stated color, until the current color is set to a different color.
Options are <EM>red</EM>,
<EM>orange</EM>,
<EM>yellow</EM>,
<EM>green</EM>,
<EM>blue</EM>,
<EM>indigo</EM>,
<EM>violet</EM>,
<EM>brown</EM>,
<EM>magenta</EM>,
<EM>gray</EM>,
<EM>white</EM>,
and
<EM>black</EM>.
<DT><B>size</B> <EM>xper</EM> yper</B>
<DD>Subsequent text will be drawn such that the text is
<EM>xper</EM>
percent of the graphics monitor display frame wide and
<EM>yper</EM>
percent of the frame high. By default, the text size is set to
1 percent of the active frame's width and 1 percent of the frame's height
if unspecified by the user (this may be too small to be seen by the user).
<BR>
<B>Note.</B> A space must separate <EM>xper</EM> and <EM>yper</EM>.
<DT><B>text</B> <EM>line-of-text</EM>
<DD>The stated text is drawn at the current location using the current color,
and the new current location is then positioned at the end of the text string.
<DT><B>icon</B> <EM>type size x y</EM>
<DD>Draws an icon of types <EM>o</EM>, <EM>x</EM>, or <EM>+</EM>
with specified <EM>size</EM> at location <EM>x,y</EM>.
Note: type <EM>o</EM> designates a square.
<BR>
<DT><B>polygon</B>
<BR> <EM> xpos ypos</EM>
<BR> <EM> xpos ypos</EM>
<BR>...
<DD>The coordinates appearing beneath the word <EM>polygon</EM>,
one pair per line,
circumscribe a polygon that is to be filled with the current color.
</DL>
<H2>EXAMPLE</H2>
For an example use of <EM>d.graph</EM>, examine the contents of the macro
command <EM>$GISBASE/bin/grass.logo.sh</EM>
located in the GRASS command bin
(which draws a GRASS logo by inputting <EM>d.graph</EM> graphics commands
that are stored in a shell file).
Note that the coordinates in the <EM>grass.logo.sh</EM> macro were
taken directly off an image drawn by hand on graph paper.
<H2>NOTES</H2>
<EM>d.graph</EM> remembers the last screen location (xpos ypos) to which
the user moved, even after the user erases the display frame.
If the user runs <EM>d.graph</EM> repeatedly, and wishes to start anew with
the default (xpos ypos) screen location, the user should <EM>clear</EM> the
display frame between runs of <EM>d.graph</EM>.
<H2>LIMITATIONS</H2>
There are no automated ways of generating graphic images. It is anticipated
that GRASS user sites will write programs to convert output from a resident
graphics editor into GRASS <EM>d.graph</EM> format.
<H2>SEE ALSO</H2>
<EM><A HREF="d.font.html">d.font</A></EM><br>
<EM><A HREF="d.mapgraph.html">d.mapgraph</A></EM><br>
<EM><A HREF="d.text.html">d.text</A></EM><br>
<EM><A HREF="grass.logo.sh.html">grass.logo.sh</A></EM><br>
<EM><A HREF="parser.html">parser</A></EM>
<H2>AUTHOR</H2>
James Westervelt, U.S. Army Construction Engineering Research Laboratory
<p><i>Last changed: $Date: 2003/04/11 14:41:45 $</i>
|