d.graph(1grass) | GRASS GIS User's Manual | d.graph(1grass) |
d.graph - Program for generating and displaying simple graphics on the display monitor.
display, cartography
d.graph
d.graph --help
d.graph [-m] [input=name]
[color=string] [--help] [--verbose]
[--quiet] [--ui]
d.graph draws graphics that are described either from standard input (default), or within a file (if an input file name is identified on the command line). If graphics commands are entered from standard input, a CTRL-d is used to signal the end of input to d.graph. Coordinates are given either as a percentage of frame height and width (default) or in geographic coordinates (with the -m flag).
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 file containing the d.graph graphics commands. If run non-interactively the d.graph command is saved to the display’s dedraw history. The user can also elect to run the program partially interactively, by specifying any/all of the parameters except the graphics file input=name parameter on the command line. In this case, d.graph will expect the user to input d.graph 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.graph on the command line, and be prompted for the values of all parameters. In this case, the user is presented with the standard GRASS GUI interface.
The default coordinate system used is 0-100 percent of the active frame in x and similarly 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. If the -m flag is given, geographic coordinates will be used instead.
The graphics language is simple, and uses the following commands:
[ # | move | draw | polygon | polyline |
color | text | size | symbol | rotation |
icon | width ]
For an example use of d.graph, examine the contents of the command file grass_logo.txt located in the d.graph source code directory. It will draw the CERL GRASS logo using the d.graph graphing commands stored in the file. Note that the coordinates in the grass_logo.txt file were taken directly off an image drawn by hand on graph paper.
A dynamic example can be found in the d.polar shell script.
echo "symbol basic/star 20 2264417 5413182 black red" | d.graph -m
d.frame -s full_screen d.graph << EOF color 80:80:120 polygon 0 49.75 0 50.25 100 50.25 100 49.75 polygon 49.85 0 50.15 0 50.15 100 49.85 100 EOF
d.graph remembers the last screen location (xpos ypos) to which the user moved, even after the user erases the display frame. If the user runs d.graph repeatedly, and wishes to start anew with the default (xpos ypos) screen location, the user should clear the display frame between runs of d.graph.
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 d.graph format. (e.g. EPS -> d.graph, perhaps with the help of a pstoedit plugin)
d.font, d.labels, d.polar, d.text, d.where
James Westervelt, U.S. Army Construction Engineering Research Laboratory
Available at: d.graph source code (history)
Accessed: Monday Apr 01 03:07:11 2024
Main index | Display index | Topics index | Keywords index | Graphical index | Full index
© 2003-2024 GRASS Development Team, GRASS GIS 8.3.2 Reference Manual
GRASS 8.3.2 |