import statgraphics.eda.Histogram;

import statgraphics.util.*;

 

/**

 *

 * <p>Example: class Histogram.</p>

 */

 

double[][] data = { {12, 14, 19, 18, 15, 15, 18, 17, 20, 27, 22, 23, 22,

                 21, 33, 28, 14, 18, 16, 13},

                {4, 2, 3, 2, 6, 9, 2, 5, 6, 6, 12, 2, 11, 9, 6, 9,

                 8, 9, 2, 7} };

String[] dataNames = {"2004", "2005"};

pf = new PlotFrame[4];

pf[0] = new PlotFrame("Histogram I",

        new Histogram(dataNames, 5, "Relative Frequency", "Histogram (R.F.)",

                      "Sales", "R. F.", data).plot, 500, 270);

pf[1] = new PlotFrame("Histogram II",

        new Histogram(dataNames, 5, "Histogram (F)", "Sales", "Frequency",

                      data).getPlot(), 500, 270);

pf[2] = new PlotFrame("Histogram III",

        new Histogram(dataNames, 5, data).plot, 500, 270);

pf[3] = new PlotFrame("Histogram IV",

        new Histogram(dataNames, data).getPlot(), 500, 270);

new PlotFrameFactory().putPlotFrame(pf);

 

Results:

 

See also:

Summarizing Quantitative Data