d.rast.leg(1)
π d.rast.leg β the GRASS GIS User's Manual glow-up π
okay bestie, so you know that one module in the GRASS GIS User's Manual called d.rast.leg? yeah. that one. sit down, hydrate, we're doing this. π«Ά
β¨ NAME β¨
d.rast.leg β literally just displays a raster map and its legend on a graphics window. two things. one window. iconic behaviour. π
πΈ KEYWORDS πΈ
display, cartography, legend β the holy trinity, no cap. β¨
π SYNOPSIS π
d.rast.leg
d.rast.leg --help
d.rast.leg [-fns] map=name [lines=integer] [raster=name] [--help]
[--verbose] [--quiet] [--ui]
that's the whole vibe. π
π Flags:
-fβ Flip legend. flip it, turn it, reverse it. π-nβ Omit entries with missing label. if it has no label, we don't talk about it. bye. π-sβ Draw smooth gradient. smooth. buttery. gorgeous. π¦--helpβ Print usage summary. when you're lost, bestie. π--verboseβ Verbose module output. it will NOT stop talking. π--quietβ Quiet module output. it will say nothing. mysterious. π€«--uiβ Force launching GUI dialog. for the visual learners. β¨
π Parameters:
map=name[required] β Name of raster map to display. this one's mandatory, no skipping it. π¨lines=integerβ Number of lines to appear in the legend. how much legend can you handle? π€raster=nameβ Name of input raster map to generate legend from. a whole other map just for the legend. main character energy for real. π
π DESCRIPTION π
d.rast.leg shows a raster map along with its legend. the way that it works? first it clears the entire screen β full reset, clean slate, we love a fresh start. π§Ό then it divides that screen into a main (left) frame and a minor (right) frame. and then: raster map goes in the main frame, map legend goes in the minor frame. boom. that's the whole thing. and the best part? the main frame stays active when the program finishes. it's still there. it's waiting for you. π«Ά
π¦ NOTES π¦
- The legend may be flipped with the
-fflag. simple as that. π - If the
linesparameter is not given, then the legend frame will display as many lines as number of categories in the map. otherwise, it will display the firstlinesminus 1 categories, with the rest being truncated. yeah. truncated. cut off. gone. π - The user may adjust the
linesparameter or the size of graphics window to get an appropriate result. you got this. fiddle with it. π - The user may specify a second raster map with the
rasterparameter from which the legend is generated. this is useful to visualize (time) series of raster maps with a common static legend instead of the default dynamic legend. so like. same legend, different maps, over and over. a legend that eats. π - To remove all frames when clearing the display, use
d.erase -f. remember this one. it matters. π
π EXAMPLE π
In this example, the polar diagram of the 'aspect' angle map in the North Carolina sample dataset is generated:
g.region raster=landclass96 -p
d.rast.leg landclass96
look at it go. π₯Ή
β SEE ALSO β
d.legend, d.erase, d.rast β go read those too, bestie, they're all in the family. π
π AUTHORS π
Jianping Xu, Scott Madry, Rutgers University
Markus Neteler
absolute legends, both of them. π
π₯ SOURCE CODE π₯
Available at: d.rast.leg source code (history)
Accessed: Saturday Jan 17 05:41:51 2026
Main index | Display index | Topics index | Keywords index | Graphical index | Full index
and that's the whole page, bestie!! π if you made it this far you're officially a GRASS GIS girlie. this was the GRASS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, running on GRASS 8.4.2 β mwah, go touch some raster data. πβ¨π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms