#
Using JPythonMethod's histogram function

May, 2001
##
Introduction

The `hist()` function in JPythonMethods provides the mechanism
to create a Histogram VisAD Data object. This consists of *bins*
of counts of values. You may use this method directly, or for simple
"bar graph" type displays, you can use the `graph.histogram()`
function.
Here are the signatures for the `hist()` funciton:

- hist(field, int[] ranges)
Return a Data object that contains counts for the indicated range
components in 20 equally-spaced bins. You may specify more than on
range component, in order to get a multi-dimensional histogram.

- hist(field, int[] ranges, int[] sizes)
Return a Data object where you specify the ranges and the bin sizes
for each.

- hist(field, set)
Return a Data object where the dimension and bin sampling are
defined by the `set`

Here's an example:
a = load("../data/mcidas/AREA0008")
h = hist(a, [0,2], [20,40])
plot(h)

Produces this display:

which maps the count of brightness values of channel 0 into 20
equally-spaced bins, the count of brightness for channel 2 into 40
bins.

Back to the home page