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.

drawLegendSymbol
void drawLegendSymbol(FigureBase fig, PlotRect where)
Undocumented in source. Be warned that the author may not have intended to support it.
drawPlot
void drawPlot(Figure form, double leftMargin, double topMargin, double plotWidth, double plotHeight)
Undocumented in source. Be warned that the author may not have intended to support it.
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(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)

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)

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

Inherited Members

From Plot

upperLim
double upperLim;
Undocumented in source.
lowerLim
double lowerLim;
Undocumented in source.
leftLim
double leftLim;
Undocumented in source.
rightLim
double rightLim;
Undocumented in source.
_legendText
string _legendText;
Undocumented in source.
resetLimits
void resetLimits(Figure figure)
Undocumented in source. Be warned that the author may not have intended to support it.
measureLegend
PlotSize measureLegend(Font legendFont, FigureBase fig)
Undocumented in source. Be warned that the author may not have intended to support it.
drawLegendSymbol
void drawLegendSymbol(FigureBase fig, PlotRect where)
Undocumented in source.
drawPlot
void drawPlot(Figure , double , double , double , double )
Undocumented in source.
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