.TH d.legend 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBd.legend\fR\fR - Displays a legend for a raster map in the active frame of the graphics monitor. .SH KEYWORDS display, cartography .SH SYNOPSIS \fBd.legend\fR .br \fBd.legend help\fR .br \fBd.legend\fR [\-\fBmvcnsf\fR] \fBmap\fR=\fIname\fR [\fBcolor\fR=\fIname\fR] [\fBlines\fR=\fIinteger\fR] [\fBthin\fR=\fIinteger\fR] [\fBlabelnum\fR=\fIinteger\fR] [\fBat\fR=\fIbottom,top,left,right\fR] [\fBuse\fR=\fIcatnum\fR[,\fIcatnum\fR,...]] [\fBrange\fR=\fImin,max\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-m\fR" 4m .br Use mouse to size & place legend .IP "\fB\-v\fR" 4m .br Do not show category labels .IP "\fB\-c\fR" 4m .br Do not show category numbers .IP "\fB\-n\fR" 4m .br Skip categories with no label .IP "\fB\-s\fR" 4m .br Draw smooth gradient .IP "\fB\-f\fR" 4m .br Flip legend .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBmap\fR=\fIname\fR" 4m .br Name of raster map .IP "\fBcolor\fR=\fIname\fR" 4m .br Text color .br Either a standard color name or R:G:B triplet .br Default: \fIblack\fR .IP "\fBlines\fR=\fIinteger\fR" 4m .br Number of text lines (useful for truncating long legends) .br Options: \fI0-1000\fR .br Default: \fI0\fR .IP "\fBthin\fR=\fIinteger\fR" 4m .br Thinning factor (thin=10 gives cats 0,10,20...) .br Options: \fI1-1000\fR .br Default: \fI1\fR .IP "\fBlabelnum\fR=\fIinteger\fR" 4m .br Number of text labels for smooth gradient legend .br Options: \fI2-100\fR .br Default: \fI5\fR .IP "\fBat\fR=\fIbottom,top,left,right\fR" 4m .br Size and placement as percentage of screen coordinates (0,0 is lower left) .br bottom,top,left,right .br Options: \fI0-100\fR .IP "\fBuse\fR=\fIcatnum[,\fIcatnum\fR,...]\fR" 4m .br List of discrete category numbers/values for legend .IP "\fBrange\fR=\fImin,max\fR" 4m .br Use a subset of the map range for the legend (min,max) .PP .SH DESCRIPTION \fId.legend\fR displays a legend for a user-specified raster map layer in the active frame on the graphics monitor. .PP The user can run \fId.legend\fR either non-interactively or interactively. If the user specifies the name of a raster \fBmap\fR layer on the command line, the program will run non-interactively. Default legend text \fBcolor\fR and position will be used unless the user specifies other values on the command line. .PP Alternately, the user can simply type \fBd.legend\fR on the command line; in this case, the program will prompt the user for parameter values using the standard GRASS GUI interface. .SH NOTES The legend's default size is based on the dimensions of the active frame, specifically its height. \fId.legend\fR will only obscure those portions of the active frame that directly underlie the legend. .PP When using the mouse or \fBat\fR to size & place the legend, a user may create a horizontal legend by making the box wider than it is tall. .PP Raster maps based on floating point values will display smoothed, from greatest to smallest value, while categorial raster maps will display in order, from top to bottom. Horizontal legends will always be smoothed. If the box is defined with inverted y-values or an inverted \fBrange\fR, the legend will automatically flip. If this is not the desired result, the \fB-f\fR flag may be used to flip it back. .PP If the user attempts to display a very long legend in a relatively short display frame, the legend may appear in unreadably small text, or even revert to a smooth gradient legend. Use the \fBlines\fR, \fBthin\fR, \fBuse\fR, \fBrange\fR, and/or \fB-n\fR options to reduce the number of categories to be displayed, or the \fB-s\fR flag to force a smooth gradient legend. .PP The \fBlines\fR option will display the first number of categories, as defined by \fIvalue\fR, contained in the raster map. When used with the \fB-n\fR flag, it takes on a new meaning: "up to category #". When used with both \fBthin\fR and the \fB-n\fR flag, its meaning becomes more obscure. When using \fBlines\fR, auto-scaled text similar to "4 of 16 categories" will be placed at the bottom of the legend. .PP The \fBthin\fR option sets the thinning factor. For raster maps with a 0th category, \fBthin=\fR\fI10\fR gives cats [0,10,20,...]. For raster maps starting at category 1, \fBthin=\fR\fI10\fR gives cats [1,11,21,...]. .PP The \fBuse\fR option lets the user create a legend made up of arbitrary category values. e.g. \fBuse=\fR\fI1000,100,10,0,-10,-100,-1000\fR .PP The \fBrange\fR option lets the user define the minimum and maximum categories to be used in the legend. It may also be used to define the limits of a smooth gradient legend created from a raster containing floating point values. Note the color scale will remain faithful to the category values as defined with \fIr.colors\fR, and the \fBrange\fR may be extended to the limits defined by the \fIr.colors\fR color map. .PP The flag \fB-n\fR is useful for categorial maps, as it suppresses the drawing of non-existing categories (otherwise the full range is shown). .PP Vertical legends produced with \fId.legend\fR will place text labels to the right of the legend box, horizontal legends will place text below. This text will be auto-scaled to fit within the frame, reducing the size of the legend if necessary. Legends positioned with the mouse or with the \fBat\fR option will not auto-scale text, in order to provide more control to the user. Smaller text may be obtained in this case by reducing the height of the box. The \fB-c\fR and \fB-v\fR flags may be used to suppress the display of category numbers and labels respectively, or used together to suppress all text of categorial raster maps. .PP The text produced from floating-point raster maps will automatically create output with a meaningful number of significant digits. For very small values, numbers will be expressed in scientific notation, e.g. "1.7e-9". .PP Legends placed with the mouse are not saved to the display window's history for automatic redraw. By setting the Debug level to 1 (see \fIg.gisenv\fR) the corresponding \fBat\fR setting can be determined. .PP Note that old scripts which relied on setting \fBlines\fR greater than the number of categories to scale the legend may no longer produce the desired output, although the auto-scaling should still produce something that looks good in this case. .SH SEE ALSO \fId.barscale\fR .br \fId.colors\fR .br \fId.colortable\fR .br \fId.erase\fR .br \fId.font\fR .br \fId.font.freetype\fR .br \fId.grid\fR .br \fId.rast\fR .br \fId.rast.leg\fR .br \fId.text\fR .br \fId.text.freetype\fR .br \fId.vect.thematic\fR .br \fId.what.rast\fR .br \fIg.gisenv\fR .br \fIr.reclass\fR .br .SH AUTHORS Bill Brown, U.S. Army Construction Engineering Research Laboratories .br Late 2002: Rewrite of much of the code. Hamish Bowman, Otago University, New Zealand .br Additional improvements from various authors .PP \fILast changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team