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 mapsonly). 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 anR:G:Btriplet. Default:black.bgcolor=nameβ the background color. standard color name,R:G:Btriplet, or"none". Default:white.nsteps=integerβ how many steps to divide the data range into (fp mapsonly, 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
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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