use of uk.ac.sussex.gdsc.core.utils.DoubleData in project GDSC-SMLM by aherbert.
the class CmosAnalysis method showHistogram.
private static void showHistogram(String name, double[] values, int bins, Statistics stats, WindowOrganiser wo) {
final DoubleData data = DoubleData.wrap(values);
final double minWidth = 0;
final int removeOutliers = 0;
final int shape = Plot.CIRCLE;
final String label = String.format("Mean = %s +/- %s", MathUtils.rounded(stats.getMean()), MathUtils.rounded(stats.getStandardDeviation()));
final HistogramPlot histogramPlot = new HistogramPlotBuilder(TITLE, data, name).setMinBinWidth(minWidth).setRemoveOutliersOption(removeOutliers).setNumberOfBins(bins).setPlotShape(shape).setPlotLabel(label).build();
histogramPlot.show(wo);
// Redraw using a log scale. This requires a non-zero y-min
final Plot plot = histogramPlot.getPlot();
final double[] limits = plot.getLimits();
plot.setLimits(limits[0], limits[1], 1, limits[3]);
plot.setAxisYLog(true);
plot.updateImage();
}
Aggregations