CHistogram:GetBinCount CHistogram:GetMax

CHistogram:GetBinWidth


The GetBinWidth method returns the actual bin width used by the histogram Calc method. This method is useful after setting the binning strategy with the SetBinCount or SetBinAuto method since, in both cases, the bin width is calculated from other parameters.

Syntax

nWidth = CHistogram:GetBinWidth( )

Example

The following script retrieves the bin width for use in setting up an x axis for plotting the histogram.

H = CHistogram:new()

-- create a Histogram object

v = GaussDev( 1000000 )

-- create this number of random deviates

y = H:Calc( v )

 

x = Index( H:GetBinCount(), H:GetMin()+H:GetBinWidth()/2, H:GetBinWidth() )

SteplinePlot( x, y )

-- plot the histogram using default settings

H:delete()

 

Related Topics

CHistogram Class, SetBinWidth