shithub: riscv

ref: 6a3c510a4e864da781a5aac3b01d68c3368b9e3a
dir: /sys/man/8/histogram/

View raw version
.TH HISTOGRAM 8
.SH NAME
histogram \- draw a histogram
.SH SYNOPSIS
.B histogram
[
.B -h
]
[
.B -c
.I index
]
[
.B -r
.I minx,miny,maxx,maxy
]
[
.B -s
.I scale
]
[
.B -t
.I title
]
[
.B -v
.I maxv
]
.SH DESCRIPTION
.I Histogram
reads numbers, one per line, from its standard input
and draws them as bars in a histogram.
.PP
Use
.B -c
to set the color
.I index
for the graph.
A modulus operation on the value keeps the color index within the available range.
.PP
Unless
.B -h
.RI ( hold )
is given,
.I histogram
will exit when it reaches the end-of-file.
It will exit immediately if it is interrupted
or if the
.I exit
menu option is chosen.
.PP
.B -r
sets the initial window
.I rectangle
coordinates.
.PP
.B -s
sets the
.I scaling
factor.
.PP
.B -t
sets the
.I title
displayed on a line above the histogram.
The last value read is displayed to the right of the title.
.PP
.B -v
sets the maximum
.I value
that can be expected.
.SH EXAMPLE
Plot a sine wave:
.IP
.EX
hoc -e 'for(i=0.0;i<20*PI;i=i+0.1) print (10+10*sin(i)), "\\n"'|
	histogram -t 'sin(t), 0 ≤ t ≤ 20π' -v 20 -h
.EE
.PP
Show the Dow Jones adjusted daily closing price back to January 1, 2000:
.IP
.EX
site=http://ichart.finance.yahoo.com
hget $site'/table.csv?s=^DJI&a=00&b=1&c=2000' |
	awk -F, '{print $NF}' | histogram -t DJI -v 15000 -h
.EE
.SH SOURCE
.B /sys/src/cmd/histogram.c
.SH SEE ALSO
.IR statusbar (8)