I need to produce a distribution plot for more than one group e.g.
Group 1: mean = 3, standard deviation = 1
Group 2: mean = 4, standard deviation = 1
Group 3: mean = 5, standard deviation = 1
And then plot the distribution for each group on the same chart, kind of like this:
i7.photobucket.com/albums/y260/-alsvartr-/dist.jpg
I understand how to plot a graph for each group seperately, but cannot combine them.
Code: Select all
/* Create function */
Function2D group1 = new NormalDistributionFunction2D(3.0, 1.0);
Function2D group2 = new NormalDistributionFunction2D(2.0, 1.0);
Function2D group3 = new NormalDistributionFunction2D(2.0, 1.0);
/* Create data set based on function */
XYDataset dataset = DatasetUtilities.sampleFunction2D(group1, -5.0, 5.0, 100, "Group1");
XYDataset dataset2 = DatasetUtilities.sampleFunction2D(group2, -5.0, 5.0, 100, "Group2");
Thanks!