Exemplo n.º 1
0
 /// <summary>
 /// Test MatShow.
 /// </summary>
 public static void MatShow()
 {
     var plotter = new Plotter { Grid = false };
     var random = new Random(0);
     var data = Enumerable.Range(0, 20).Select(
         i => Enumerable.Range(0, 10).Select(
             j => random.NextDouble() - 0.5).ToArray()).ToArray();
     plotter.Series = new ISeries[] { new MatrixSeries { Values = data, ColorMap = "gray" } };
     plotter.Title = "MatShow";
     plotter.Plot();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Test Hinton diagrams.
 /// </summary>
 public static void Hinton()
 {
     var plotter = new Plotter { Grid = false };
     var random = new Random(0);
     var data = Enumerable.Range(0, 20).Select(
         i => Enumerable.Range(0, 10).Select(
             j => random.NextDouble() - 0.5).ToArray()).ToArray();
     plotter.Series = new ISeries[] { new HintonSeries { Values = data } };
     plotter.Title = "Hinton diagram";
     plotter.Plot();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Tests Subplots.
        /// </summary>
        public static void Subplots()
        {
            var zeros = Enumerable.Repeat(0.0, 150).ToArray();
            var ones = Enumerable.Repeat(1.0, 100).ToArray();
            var sine = Enumerable.Range(0, 400).Select(x => Math.Sin(x / 10.0)).ToArray();

            // zObs = new[] { zeros.Concat(ones).Concat(zeros).ToArray(), sine };
            var plotter = new Plotter { Subplots = new Subplots { Rows = 2, Columns = 1 }, Title = "Subplots" };
            plotter.Series = new ISeries[]
            {
                new LineSeries { X = zeros.Concat(ones).Concat(zeros).ToArray(), Row = 0, Label = "square" },
                new LineSeries { X = sine, Row = 1, Label = "$sin(x)$" }
            };
            plotter.Plot();
        }