CHistogram:new


The new method constructs a new instance of a CHistogram object. You must call new before using any class methods or properties.

Syntax

H = CHistogram:new()

H = CHistogram:new( CHistogram2 )

where

    The first form with no creates a default CHistogram object with default properties.

    The second form creates a new CHistogram object inedependent of, but having the same properties as, an existing CHistogram2 object.

    a new CHistogram object H is returned.

Example

The following script creates a CHistogram object with default properties and uses it to calculate the histogram of a table of data.

H = CHistogram:new()

-- create a Histogram object

y = H:Calc( TGaussDev(1000000) )

-- compute a histogram

x = TSeries( H:GetBinCount() )

-- create x axis values for each histogram bin.

PlotStep( x, y )

-- plot the histogram

H:delete()

-- clean up memory when done

Related Topics

delete

CHistogram Class