Table of Contents

Class Histogram

Namespace
ScottPlot.Statistics
Assembly
ScottPlot.dll

A histogram that accumulates the number of values observed in a continuous range of user defined bins

public class Histogram
Inheritance
Histogram
Inherited Members
Extension Methods

Properties

Bins

Lower edge of each bin

public double[] Bins { get; }

Property Value

double[]

Counts

Number of values in each bin

public int[] Counts { get; }

Property Value

int[]

Edges

Lower edge of each bin plus a final value representing the upper edge of the last bin

public double[] Edges { get; }

Property Value

double[]

FirstBinSize

Size of the first bin (distance between the first pair of bin edges)

public double FirstBinSize { get; }

Property Value

double

IncludeOutliers

If enabled, values below or above the bin range will be accumulated in the lowest or highest bin

public bool IncludeOutliers { get; set; }

Property Value

bool

Methods

Add(double)

public void Add(double value)

Parameters

value double

AddRange(IEnumerable<double>)

public void AddRange(IEnumerable<double> values)

Parameters

values IEnumerable<double>

Clear()

public void Clear()

GetCumulativeCounts()

Return the cumulative sum of all counts. Each value is the number of counts in that bin plus all bins below it.

public int[] GetCumulativeCounts()

Returns

int[]

GetCumulativeProbability(double)

Return the cumulative probability histogram. Each value is the fraction of counts in that bin plus all bins below it.

public double[] GetCumulativeProbability(double scale = 1)

Parameters

scale double

Returns

double[]

GetNormalized(double)

Return the probability of each bin scaled so the peak is maxValue

public double[] GetNormalized(double maxValue = 1)

Parameters

maxValue double

Returns

double[]

GetProbability(double)

Return counts normalized so the sum of all values equals 1

public double[] GetProbability(double scale = 1)

Parameters

scale double

Returns

double[]

WithBinCount(int, IEnumerable<double>)

A collection of count evenly sized bins spaced to include the full range of values

public static Histogram WithBinCount(int count, IEnumerable<double> values)

Parameters

count int
values IEnumerable<double>

Returns

Histogram

WithBinCount(int, double, double)

A collection of count evenly sized bins. minValue is the lower edge of the first bin. maxValue is the lower edge of the last bin.

public static Histogram WithBinCount(int count, double minValue, double maxValue)

Parameters

count int
minValue double
maxValue double

Returns

Histogram

WithBinSize(double, IEnumerable<double>)

A collection of bins of size binSize starting from the smallest value in values and increasing to include the largest value in values

public static Histogram WithBinSize(double binSize, IEnumerable<double> values)

Parameters

binSize double
values IEnumerable<double>

Returns

Histogram

WithBinSize(double, double, double)

A collection of bins of size binSize where the first bin's left edge is firstBin and the last bin's left edge is lastBin

public static Histogram WithBinSize(double binSize, double firstBin, double lastBin)

Parameters

binSize double
firstBin double
lastBin double

Returns

Histogram