Exemple #1
0
        /// <summary>
        /// Pan by a certain number of PIXELS (useful for mouse tracking)
        /// </summary>
        public static void demo_009()
        {
            // create a new ScottPlot figure
            var fig = new ScottPlot.Figure(640, 480);

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

            // 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_009.png");
        }