histogram

From DavinciWiki
Jump to: navigation, search


Description

Generate a histogram

Arguments and Return Values

Arguments: An array, and histogram parameters

Return Value: A 2xN array containing axis values and occurrences respectively

Usage

Syntax: histogram(object=VAL, [start=FLOAT], [size=FLOAT], [steps=INT], [compress=BOOL], [normalize=BOOL], [cumulative=BOOL])

The histogram function sorts its input data into some number of bins, and produces a 2xN array of FLOATs as output. The first column of the output contains the start value of each bin, and the second column contains the number of input values that fell in that bin.

If the input object is in BYTE or SHORT format, the histogram will be auto-scaled to the 2^8 or 2^16 bins and each bin will have a width of 1. Otherwise, the user MUST provide at least the number of bins (steps) to be included in the histogram.

If the start and size values aren't given, they are computed from the the minimum and maximum values of the input data.

The compress options removes all bins with a value of 0. The normalize option divides each bin by the total number of elements.

The cumulative option produces a cumulative histogram.

Examples

dv> a
329x7183x1 array of float, bsq format [9,452,828 bytes]

dv> h=histogram(a,start=0.0002,size=.000001,steps=350)
2x350x1 array of float, bsq format [2,800 bytes]

dv> xplot(h[2],Xaxis=h[1])

Images

hist.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 03-03-2006

Personal tools