Beispiel #1
0
        ScottPlot.Statistics.BoxAndWhisker GetBoxAndWhisker(double[] data, double xPosition)
        {
            var baw = new ScottPlot.Statistics.BoxAndWhisker(xPosition);

            var stats = new ScottPlot.Statistics.PopulationStats(data);

            baw.midline.position = stats.median;
            baw.whisker.max      = stats.max;
            baw.whisker.min      = stats.min;
            baw.box.max          = stats.mean + stats.stDev;
            baw.box.min          = stats.mean - stats.stDev;

            return(baw);
        }
Beispiel #2
0
        private void Plot_ScottVersion()
        {
            var boxAndWiskers = new ScottPlot.Statistics.BoxAndWhisker[3];

            boxAndWiskers[0] = GetBoxAndWhisker(LineLengths.plot, 1);
            boxAndWiskers[1] = GetBoxAndWhisker(LineLengths.formsPlot, 2);
            boxAndWiskers[2] = GetBoxAndWhisker(LineLengths.wpfPlot, 3);

            formsPlot1.plt.Title("Source Code Line Length (Scott's Version)");
            formsPlot1.plt.PlotBoxAndWhisker(boxAndWiskers);
            formsPlot1.plt.YLabel("Number of Characters");

            // set X axis tick labels manually
            double[] xPositions = { 1, 2, 3 };
            string[] labels     = { "Plot.cs", "FormsPlot.cs", "WpfPlot.cs" };
            formsPlot1.plt.XTicks(xPositions, labels);

            formsPlot1.plt.AxisAuto(.3, .2);
            formsPlot1.Render();
        }