DiscreteFunction

Plot a callable object on a range of values.

Members

Static functions

fromAlias
DiscreteFunction fromAlias(int lowerLim, int upperLim)

Create a DiscreteFunction using a template alias parameter instead of a callable object.

opCall
DiscreteFunction opCall(scope C callable, int lowerLim, int upperLim)

Create a DiscreteFunction. C is any callable type mapping an integer to a number. lowerLim is the lower limit of the plot. upperLim is the upper limit of the plot.

Inherited Members

From BarPlot

barColor
Color barColor()

Controls the color of the bar. Defaults to blue.

barColor
This barColor(Color newColor)

Setter

outlineBar
bool outlineBar()

Controls whether each bar is outlined in a black rectange.

width
double width;
opCall
BarPlot opCall(R1 centers, R2 heights, double width)

Create a BarPlot. centers and heights must be input ranges with elements implicitly convertible to double. width determines the width of each bar relative to the X-axis scale and must be greater than 0.

opCall
BarPlot opCall(R1 centers, R2 heights, double width, R3 lowerErrors, R4 upperErrors)

Create a BarPlot with error bars. lowerErrors and upperErrors must be input ranges with elements implicitly convertible to double for error bars to be shown. Any other value, such as null or 0, will result in no error bars being shown. Therefore, to only show, for example, upper erros, simply pass in null or 0 for the lower errors.

stack
BarPlot stack(R heights)

Create a BarPlot that is to be stacked on top of this one. For a convenience function for creating such a plot, see stackedBar().

scaleCenters
void scaleCenters(double scaleFactor)

Scale this object by a factor of scaleFactor in the X direction. This is useful for getting it onto the same scale as another plot.

scaleHeights
void scaleHeights(double scaleFactor)

Scale this object by a factor of scaleFactor in the Y direction. * This is useful for getting it onto the same scale as another plot.

shiftCenters
void shiftCenters(double shiftBy)

Shift this graph by shiftBy units in the X direction. This is useful for getting it onto the same scale as another plot.

centers
const(double)[] centers()

Get the centers of the bars.

heights
const(double)[] heights()

Get the heights of the bars.

lowerErrors
const(double)[] lowerErrors()
upperErrors
const(double)[] upperErrors()
toLabeledFigure
Figure toLabeledFigure()

The default labeling includes each center receiving its own x tick label if there are <= 10 bars on the graph.

Meta