d.histogram(1grass)

✨ NAME ✨

okay bestie, say hi to d.histogram β€” the GRASS module that serves up a histogram as a pie chart or a bar chart for whatever raster map you tell it to. it's giving data visualization, it's giving category-value distribution, and honestly it's iconic. πŸ‘‘

🌸 KEYWORDS 🌸

display, histogram, statistics

🫢 SYNOPSIS 🫢

d.histogram
d.histogram --help
d.histogram [-nc] map=name  [style=string]   [color=name]
[bgcolor=name]   [nsteps=integer]   [--help]  [--verbose]  [--quiet]
[--ui]

πŸŽ€ Flags πŸŽ€

  • -n β€” shows you the info for null cells. not ignoring the empty ones, periodt.
  • -c β€” report for ranges defined in the cats file (fp maps only). like, floating point maps only, bestie.
  • --help β€” prints the usage summary. when u need a lil refresher. πŸ’–
  • --verbose β€” verbose module output. the module gets chatty.
  • --quiet β€” quiet module output. the module shuts up. respectfully. 🀫
  • --ui β€” force launches the GUI dialog. main character energy, but in a window.

πŸ¦‹ Parameters πŸ¦‹

  • map=name [required] β€” the raster map whose histogram we're about to display. yes babe it's required, u literally cannot skip it.
  • style=string β€” do u want a pie or a bar chart? that's the whole question. Options: pie, bar. Default: bar.
  • color=name β€” the color for text and axes. can be a standard color name, or an R:G:B triplet. Default: black.
  • bgcolor=name β€” the background color. standard color name, R:G:B triplet, or "none". Default: white.
  • nsteps=integer β€” how many steps to divide the data range into (fp maps only, so floating point maps only). Default: 255.

πŸ’… DESCRIPTION πŸ’…

so d.histogram displays the category-value distribution for a raster map layer that you specify, and it does it in the form of a bar chart or a pie chart. the display shows up in the active display frame on the graphics monitor, and it uses the colors from the raster map layer's own color table. the program figures out the raster map's category value distribution by counting cells. that's the whole vibe. πŸ“

🌈 NOTES 🌈

d.histogram respects the current geographic region settings and the current raster mask (if a mask is active). no cap.

also, d.histogram uses the colors in the map's color look-up table β€” i.e., the map's colr or colr2 file. that's where the pretty comes from. ✨

πŸ”₯ EXAMPLES πŸ”₯

run the command below and it'll generate that bar graph from the figure:

g.region raster=elevation -p
d.mon wx0
d.histogram map=elevation

Figure: Bar graph histogram for elevation map

and run the command below to get the pie graph from the figure:

g.region raster=landuse96_28m -p
d.histogram map=landuse96_28m style=pie

Figure: Pie graph histogram for landuse map

slay. two charts, both gorgeous, no notes. πŸ₯§πŸ“Š

πŸ‘€ SEE ALSO πŸ‘€

d.colortable, d.frame, d.graph, d.linegraph, d.mon, d.polar, g.region, r.stats

πŸ’œ AUTHOR πŸ’œ

Dave Johnson DBA Systems, Inc. 10560 Arrowhead Drive Fairfax, Virginia 22030

⭐ SOURCE CODE ⭐

Available at: d.histogram source code (history)

Latest change: Friday Sep 05 13:38:04 2025 in commit: 6112ef0fc4c12145eb4ef69e842c77f9bbd7308e

Main index | Display index | Topics index | Keywords index | Graphical index | Full index


okay that's the whole page bestie, tysm for reading 🫢 β€” this was GRASS 8.5.0, Β© 2003-2026 GRASS Development Team, straight outta the GRASS 8.5.0 Reference Manual, last touched Friday Sep 05 13:38:04 2025. go make some histograms, ur gonna eat. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from