Example #1
0
        /// <summary>
        /// Zooming
        /// </summary>
        public static void demo_002()
        {
            var fig = new ScottPlot.Figure(640, 480);

            fig.labelTitle = "Super Special Data";
            fig.labelY     = "Random Walk";
            fig.labelX     = "Sample Number";

            double[] Xs = fig.gen.Sequence(123);
            double[] Ys = fig.gen.RandomWalk(123);

            fig.AxisAuto(Xs, Ys, null, null); // fit data precisely
            fig.Zoom(2, .5);                  // now zoom in horizontally and out vertically

            fig.PlotLines(Xs, Ys, 1, Color.Red);
            fig.PlotScatter(Xs, Ys, 5, Color.Blue);

            fig.Save("output/demo_002.png");
        }
Example #2
0
        /// <summary>
        /// Draw a square with an X in it
        /// </summary>
        public static void demo_007()
        {
            // create a new ScottPlot figure
            var fig = new ScottPlot.Figure(640, 480);

            // zoom and pan axes before drawing on them
            fig.Zoom(.8, .8);

            // draw a blue X
            fig.PlotLines(-10, 10, -10, 10, 5, Color.Blue);
            fig.PlotLines(-10, 10, 10, -10, 5, Color.Blue);

            // draw a red rectangle
            double[] Xs = { -10, 10, 10, -10, -10 };
            double[] Ys = { -10, -10, 10, 10, -10 };
            fig.PlotLines(Xs, Ys, 5, Color.Red);

            // save the file
            fig.Save("output/demo_007.png");
        }