Example usage for org.jfree.data.function NormalDistributionFunction2D NormalDistributionFunction2D

List of usage examples for org.jfree.data.function NormalDistributionFunction2D NormalDistributionFunction2D

Introduction

In this page you can find the example usage for org.jfree.data.function NormalDistributionFunction2D NormalDistributionFunction2D.

Prototype

public NormalDistributionFunction2D(double mean, double std) 

Source Link

Document

Constructs a new normal distribution function.

Usage

From source file:edu.ucla.stat.SOCR.chart.ChartGenerator_JTable.java

private XYDataset createXYNDDataset() {
    String[][] x = new String[xyLength][no_series];
    double[][] y = new double[xyLength][no_series];

    for (int index = 0; index < no_series; index++)
        for (int i = 0; i < xyLength; i++)
            x[i][index] = indepValues[i][index];

    for (int index = 0; index < no_series; index++)
        for (int i = 0; i < xyLength; i++)
            y[i][index] = Double.parseDouble(depValues[i][index]);

    double mean = Double.parseDouble(x[0][0]);
    double stdDev = y[0][0];
    Function2D normal = new NormalDistributionFunction2D(mean, stdDev);
    XYDataset dataset = DatasetUtilities.sampleFunction2D(normal, -10.0, 10.0, 100, "Normal");

    return dataset;
}