Skip to content

Instantly share code, notes, and snippets.

@VisualMelon
Created August 29, 2023 15:23
Show Gist options
  • Save VisualMelon/ec1c6cb255344e26a88eb569cf622bf6 to your computer and use it in GitHub Desktop.
Save VisualMelon/ec1c6cb255344e26a88eb569cf622bf6 to your computer and use it in GitHub Desktop.
Histogram Fudges
[Example("Exponential Distribution")]
[DocumentationExample("Series/HistogramSeries")]
public static PlotModel ExponentialDistribution()
{
var plot = CreateExponentialDistribution();
plot.Title += " Height";
return plot;
}
[Example("Exponential Distribution Count")]
public static PlotModel ExponentialDistributionCount()
{
var plot = CreateExponentialDistribution();
var hs = plot.Series.First(s => s is HistogramSeries) as HistogramSeries;
plot.Title += " Count";
foreach (var hi in hs.Items)
hi.Area = hi.Count * hi.Width;
return plot;
}
[Example("Exponential Distribution Area")]
public static PlotModel ExponentialDistributionProp()
{
var plot = CreateExponentialDistribution();
var hs = plot.Series.First(s => s is HistogramSeries) as HistogramSeries;
plot.Title += " Area";
foreach (var hi in hs.Items)
hi.Area = hi.Area * hi.Width;
return plot;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment