NAME

d.mapgraph - Generates and displays simple graphics on map layers drawn in the active graphics monitor display frame.
(GRASS Display Program)

SYNOPSIS

d.mapgraph
d.mapgraph help
d.mapgraph [input=name] [color=name]

DESCRIPTION

d.mapgraph draws graphics that are described in standard input (default) or the UNIX input file name. If commands are entered via standard input, a ctrl-d is used to signal the end of input to d.mapgraph. This program performs essentially the same function as d.graph; however, point locations are specified to d.mapgraph in the geographic coordinate system of the user's current mapset and location (i.e., in map coordinates), rather than in graphics display screen coordinates.

The program can be run interactively or non-interactively. The user can run the program completely non-interactively by specifying the name of a file containing d.mapgraph 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 except the graphics input=name parameter on the command line. In this case, d.mapgraph will expect the user to input d.mapgraph graphics commands from standard input (i.e., the keyboard) and will (silently) prompt the user for these graphics commands. Alternately, the user can simply type d.mapgraph on the command line, and be prompted for the values of all parameters (the user can still input graphics commands from an input file using this form.) In this case, the user is presented with the standard GRASS parser interface.

OPTIONS

Parameters:

input=name
Name of a UNIX file containing graphics instructions. Specify the full path name of the file if not in the current directory. If no file name is given, commands are taken from standard input.
color=name
Starting color desired for graphics.
Options: red, orange, yellow, green, blue, indigo, violet, magenta, brown, gray, white, and black.
Default: white
d.mapgraph is used for drawing simple graphics on top of map layers. The coordinate system used by d.mapgraph is the same as that of the map layer displayed in the active display frame on the graphics monitor (or that of the user's current region, if no map is displayed).

The graphics language is simple and uses the following commands:

# comment
A line of comment which is ignored in the processing.
move xpos ypos
The current location is updated to xpos ypos (where these, respectively, are the easting and northing of geographic coordinates stated in the map coordinate system of the user's current GRASS location, falling within the current region and active frame). If unspecified by the user, the current location becomes (0,0). If, as most likely, the point (0,0) falls outside of the user's current region, graphics drawn there will not appear in the graphics frame.

Note: use g.region to obtain the coordinates of current location. Use d.where to obtain specific map coordinates of various points on the raster map displayed in the active frame.
Note: there must be a space between xpos and ypos.

draw xpos ypos
A line is drawn in the current color from the current location to the new location xpos ypos, which then becomes the current location. xpos and ypos are (respectively) an easting and northing stated in the map coordinate system of the user's current GRASS location, and located within the user's current geographic region and active frame.

Note: there must be a space between xpos and ypos.

color color
Sets the current color to that stated. Color options are: red, orange, yellow, green, blue, indigo, violet, magenta, brown, gray, white, and black.
size xper yper
Subsequent text will be drawn such that the text is xper percent of the display frame's width and yper percent of the display frame height. If not specified by the user, the text size becomes 5 percent of the active frame's width and 5 percent of the frame's height. This is equivalent to entering size 5 5.
text line-of-text
The stated text is drawn at the current location using the current color and the current size.
icon type size x y
Draws an icon of types o, x, or + with specified size at location x,y. Note: type o designates a square.
polygon xpos ypos
xpos ypos
.
.
.
The map coordinates appearing on lines beneath the word polygon, one pair per line, circumscribe a polygon which is to be filled with the current color.

NOTES

d.mapgraph is identical to the d.graph command, except for the difference in coordinate systems used.

d.mapgraph will complain if the user enters something to standard input that it does not understand. Blank lines in the input file will result in this error message.

SEE ALSO

d.frame
d.graph
d.rast
d.zoom
g.region
grass.logo.sh
parser

AUTHOR

James Westervelt, U.S. Army Construction Engineering Research Laboratory