GRASS logo

NAME

v.histogram - Draws the histogram of values in a vector attribute column

KEYWORDS

vector, plot, histogram

SYNOPSIS

v.histogram
v.histogram --help
v.histogram map=name [layer=string] column=name [where=sql_query] plot_output=name [bins=integer] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

map=name [required]
Name of vector map
Or data source for direct OGR access
layer=string
Layer number or name
Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.
Default: 1
column=name [required]
Attribute column to create histogram from
where=sql_query
WHERE conditions of SQL statement without 'where' keyword
Example: income < 1000 and population >= 10000
plot_output=name [required]
Name for graphic output file for plot (extension decides format, - for screen)
Name for output file
Default: -
bins=integer
Number of bins in histogram
Default: 30

Table of contents

DESCRIPTION

v.histogram draws a histogram of the values in a vector map attribute column. Users can use the where option to only select a subset of the attribute table and can determine the number of bins (bars) used for the histogram. The plot_output parameter determines whether the result is displayed on screen (default) or exported to a graphics file.

NOTE

This is a quick and dirty solution using basic matplotlib. In future, this should be integrated into the g.gui, possibly together with the raster histogram tool.

EXAMPLE

Show the histogram of median age values in the census block map:
v.histogram map=censusblk_swwake column=MEDIAN_AGE where="TOTAL_POP>0"

Histogram of median age values in census blocks

AUTHOR

Moritz Lennert

SOURCE CODE

Available at: v.histogram source code (history)

Latest change: Thursday Apr 18 16:03:04 2024 in commit: 32336efa800ee9cb0054596a731152f92e0cda3d


Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.4.1dev Reference Manual