Пример #1
0
        static void HistogramExample()
        {
            var rnd = new Random();

            var plot = Plot.Linear("Frequency", "Joyness");

            plot.Histogram(Uniform(rnd, 15, 5, 250, 3));

            Snel.Show(plot, "A box plot");
        }
Пример #2
0
        static void BoxPlotExample()
        {
            var rnd = new Random();

            var plot = BoxPlotting.PrepareBoxPlot(new[] { "OxySnel", "SloomPlot" }, "Package", "Joyness");

            BoxPlotting.BoxPlot(plot, new[] { Uniform(rnd, 15, 5, 80, 3), Uniform(rnd, 10, 8, 50, 3) });

            Snel.Show(plot, "A box plot").ContinueWith(t => t.Result.Model.ShowMenu = false);
        }
Пример #3
0
        static void QuickAndEasyExamples()
        {
            var rnd = new Random();

            // generate random data
            var xs  = Enumerable.Range(0, 101).Select(i => (double)i).ToList();
            var ys1 = xs.Select(x => x + x * rnd.NextDouble()).ToList();
            var ys2 = xs.Select(x => x * 1.4 + x * rnd.NextDouble() * 0.2).ToList();

            // time plot
            var timePlot = Plot.Linear("Time", "Swans");

            timePlot.Scatter(xs, ys1);
            timePlot.Line(xs, ys2);
            Snel.Show(timePlot, "Swans over time");

            // sample plot
            var samplePlot = Plot.Linear("Value", "Frequency");

            samplePlot.Histogram(ys1);
            Snel.Show(samplePlot, "Swans");

            // matrix plot
            var matrixPlot = Plot.Linear("Col", "Row");

            matrixPlot.PlotModel.PlotType = PlotType.Cartesian;
            foreach (var a in matrixPlot.PlotModel.Axes)
            {
                if (a is LinearAxis la)
                {
                    la.MinimumMinorStep = la.MinimumMajorStep = 1;
                }
            }
            matrixPlot.LinearColorAxis(null, OxyPalettes.Hot64);
            matrixPlot.Matrix(Array2d(100, 100, (x, y) => Math.Sin(Math.Sqrt(x * x + y * y) / 10)), null);
            Snel.Show(matrixPlot);
        }