Histogram

A class for plotting regular (equal-width) histograms.

Members

Functions

barColor
Color barColor()

Controls the color of the bar. Defaults to blue.

barColor
This barColor(Color newColor)

Setter

boundsBehavior
This boundsBehavior(OutOfBounds behavior)

Determine whether this object throws or ignores if it receives a number outside its bounds via put.

cumulative
This cumulative(bool newVal)

Determines whether this histogram is cumulative.

histType
This histType(HistType newType)

Set whether this histogram displays counts or probabilities.

nBin
uint nBin()

The number of bins this histogram contains.

put
This put(double num)

Add a number to the histogram on the fly.

put
This put(const Histogram rhs)

Add the contents of another Histogram to this one. The boundaries and numbers of bins must be the same. This histogram's settings are retained.

scaleDistributionFunction
This scaleDistributionFunction(LineGraph g)

Assumes the LineGraph input is a plot of a PDF that this histogram is supposed to approximate, and scales the Y axis of the LineGraph accordingly so that both appear on the same scale.

Static functions

opCall
Histogram opCall(R nums, uint nBin)

Factory method to instantiate this class. nums must be a forward range with elements implicitly convertible to double. nBin specifies how many bins the histogram should contain.

opCall
Histogram opCall(R nums, uint nBin, double leftLim, double rightLim, OutOfBounds outOfBoundsBehavior = OutOfBounds.throwException)

Factory method to instantiate this class with predetermined limits. This allows nums to be an input range instead of a forward range, since no pass is necessary to compute the limits.

opCall
Histogram opCall(I nBin, double leftLim, double rightLim, OutOfBounds outOfBoundsBehavior = OutOfBounds.Throw)

Create an empty histogram with pre-specified bounds, which will be filled with data using the put method.

Inherited Members

From Plot

hasLegend
bool hasLegend()

Returns true if this plot type supports legends, otherwise false.

toFigure
Figure toFigure()

Convenience method that instantiates a Figure object with this plot. Useful for creating single-plot figures w/o a lot of boilerplate.

toLabeledFigure
Figure toLabeledFigure()

Instantiates a Figure object with this plot and also places the default axes and tick labeling and title for the plot type, if any, on the Figure. If a plot type has no default labeling, simply forwards to toFigure().

leftMost
double leftMost()

The leftmost point on the plot.

rightMost
double rightMost()

The rightmost point on the plot.

topMost
double topMost()

The topmost point on the plot.

bottomMost
double bottomMost()

The bottommost point on the plot.

legendText
string legendText()
legendText
This legendText(string newText)

Meta