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 -f flag. simple as that. πŸ”„
  • If the lines parameter is not given, then the legend frame will display as many lines as number of categories in the map. otherwise, it will display the first lines minus 1 categories, with the rest being truncated. yeah. truncated. cut off. gone. 😭
  • The user may adjust the lines parameter 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 raster parameter 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