Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            Plotter plotter = new Plotter(myCanvas)
            {
                PointMarksVisible = true,
                PolylineVisible   = true
            };

            myCanvas.ClipToBounds                  = true;
            myCanvas.MouseLeave                   += MyCanvas_MouseLeave;
            myCanvas.MouseEnter                   += MyCanvas_MouseEnter;
            myCanvas.MouseWheel                   += MyCanvas_MouseWheel;
            plotter.PointMarks.MarkType            = MarkerType.Circle;
            plotter.AxesWithOrigin.YScalingFactor /= 20;
            plotter.AxesWithOrigin.XScalingFactor /= 3;

            for (int i = -10; i < 11; i++)
            {
                plotter.Add(i * i, -10);
            }

            plotter.DrawAll();
        }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            myyC.ClipToBounds = true;
            Plotter p = new Plotter(myyC);

            List <DataPoint> testData = new List <DataPoint>();

            for (int i = -20; i < 20; i++)
            {
                testData.Add(new DataPoint(i, i + 1));
            }

            p.SetPoints(testData);

            p.DrawAll();
        }
Example #3
0
        public MainWindow()
        {
            InitializeComponent();

            myCanvas.ClipToBounds = true;

            plotter = new Plotter(myCanvas);
            plotter.AxesWithOrigin.Origin         = new Tuple <double, double>(0, myCanvas.Height / 2);
            plotter.AxesWithOrigin.XScalingFactor = 10;
            plotter.AxesWithOrigin.YScalingFactor = -100;
            plotter.PointMarksVisible             = true;
            plotter.PolylineVisible = false;
            plotter.DrawAll();

            xLabel.Content = $"X range: [{plotter.AxesWithOrigin.X_min}, {plotter.AxesWithOrigin.X_max}]";
            yLabel.Content = $"Y range: [{plotter.AxesWithOrigin.Y_min}, {plotter.AxesWithOrigin.Y_max}]";
        }