Beispiel #1
0
        void PlotSeven(List <Coordinate> list)
        {
            int n = list.Count;

            double[] x = new double[n];
            double[] y = new double[n];

            for (int i = 0; i < n; i++)
            {
                x[i] = i;
                y[i] = list[i].Y;
                //System.Console.WriteLine("y is "+y[i]);
            }

            Plot2DCurve curve = plotseven.AddLine(x, y);

            curve.Stroke = Brushes.Blue; curve.StrokeThickness = 1.5;
            curve.Title  = "Ground Reaction Forces";

            plotseven.Legend.Background = Brushes.White;
            plotseven.BackgroundPlot    = Brushes.White;

            plotseven.BottomLabel.Text = "Time";
            plotseven.LeftLabel.Text   = "Ground reaction force(Vertical)";
            plotseven.FontSize         = 14;

            plotseven.Axes.XAxes[0].FontStyle = plotseven.Axes.YAxes[0].FontStyle = FontStyles.Oblique;

            plotseven.Axes.XAxes.Top.TickLength  = 5;
            plotseven.Axes.YAxes.Left.TickLength = 5;

            plotseven.UseDirect2D = true;
        }
Beispiel #2
0
        void ScrollViewerPlot(Plot2D scrollViewerPlot)
        {
            Plot2DCurve curve = scrollViewerPlot.AddLine(new double[] { 1.2, 1.3, 2.8, 5.6, 1.9, -5.9 });

            scrollViewerPlot.Axes.Height = scrollViewerPlot.Axes.Width = 500;
            //scrollViewerPlot.Height = scrollViewerPlot.Width = 500;
            // Some events.
            //scrollViewerPlot.Axes.YAxes.Right.MouseEnter += new MouseEventHandler(Bottom_MouseEnter);
        }
Beispiel #3
0
        void PlotFour(List <double> list1, List <double> list2)
        {
            int n = list1.Count;

            double[] x = new double[n];
            double[] y = new double[n];

            for (int i = 0; i < n; i++)
            {
                x[i] = i;
                y[i] = list1[i];
            }

            Plot2DCurve curve = plotfour.AddLine(x, y);

            curve.Stroke = Brushes.Blue; curve.StrokeThickness = 1.5;
            curve.Title  = "Hip flexion left";

            int n2 = list2.Count;

            double[] x2 = new double[n2];
            double[] y2 = new double[n2];

            for (int i = 0; i < n2; i++)
            {
                x2[i] = i;
                y2[i] = list2[i];
            }
            Plot2DCurve curve2 = new Plot2DCurve(new Curve(x2, y2))
            {
                QuickLine = "r-"
            };

            plotfour.Children.Add(curve2);
            curve2.Title = "Hip flexion right";
            plotfour.Legend.Background = Brushes.White;
            plotfour.BackgroundPlot    = Brushes.White;

            plotfour.BottomLabel.Text = "Time";
            plotfour.LeftLabel.Text   = "Hip flexion-extension";
            plotfour.FontSize         = 14;

            plotfour.Axes.XAxes[0].FontStyle = plotfour.Axes.YAxes[0].FontStyle = FontStyles.Oblique;

            plotfour.Axes.XAxes.Top.TickLength  = 5;
            plotfour.Axes.YAxes.Left.TickLength = 5;

            plotfour.UseDirect2D = true;
        }
Beispiel #4
0
        void Plot2DMultipleAxes(Plot2D plotMultipleAxes)
        {
            // Example 2D plot:
            // First curve:
            Plot2DCurve curve1 = plotMultipleAxes.AddLine(new double[] { 1.2, 1.3, 2.8, 5.6, 1.9, -5.9 });

            curve1.Stroke          = Brushes.Blue;
            curve1.StrokeThickness = 1.5;
            curve1.MarkersType     = MarkersType.Square;
            // Second curve:
            int nPoints = 2000;

            double[] x    = new double[nPoints];
            double[] y    = new double[nPoints];
            Random   rand = new Random();

            for (int i = 0; i < nPoints; ++i)
            {
                x[i] = i * 10.0 / (double)nPoints;
                y[i] = Math.Sin(x[i]) + 0.1 * Math.Sin(x[i] * 100);
            }
            Plot2DCurve curve2 = new Plot2DCurve(new Curve(x, y))
            {
                QuickLine = "r-"
            };

            plotMultipleAxes.Children.Add(curve2);
            // Third curve:
            Plot2DCurve curve3 = new Plot2DCurve(new Curve(new double[] { 1, 3, 1.5, 7 }, new double[] { 4.5, 9.0, 3.2, 4.5 }))
            {
                StrokeThickness = 3.0, Stroke = Brushes.Green
            };

            curve3.QuickLine   = "o";
            curve3.MarkersFill = Brushes.Blue;
            curve3.Title       = "Test3";
            //curve3.QuickStrokeDash = QuickStrokeDash.Dash;
            plotMultipleAxes.Children.Add(curve3);
            // Can use Direct2D acceleration, but requires DirectX10 (Windows 7)
            //plotMultipleAxes.UseDirect2D = true;
            //plotMultipleAxes.EqualAxes = true;


            // If you want to lose the gradient background:
            //plotMultipleAxes.Legend.Background = Brushes.White;
            //plotMultipleAxes.BackgroundPlot = Brushes.White;


            // Additional labels:
            //plotMultipleAxes.BottomLabel.Text = "Bottom label";
            //plotMultipleAxes.LeftLabel.Text = "Left label";
            plotMultipleAxes.FontSize = 14;
            plotMultipleAxes.Axes.XAxes[0].AxisLabel.Text = "Innermost X Axis";
            plotMultipleAxes.Axes.YAxes[0].AxisLabel.Text = "Innermost Y Axis";
            XAxis xAxisOuter = new XAxis(); YAxis yAxisOuter = new YAxis();

            xAxisOuter.AxisLabel.Text = "Added X Axis";
            yAxisOuter.AxisLabel.Text = "Added Y Axis";
            plotMultipleAxes.Axes.XAxes.Add(xAxisOuter);
            plotMultipleAxes.Axes.YAxes.Add(yAxisOuter);
            yAxisOuter.Position = YAxisPosition.Left;
            plotMultipleAxes.Axes.XAxes[0].FontStyle = plotMultipleAxes.Axes.YAxes[0].FontStyle = FontStyles.Oblique;
            //curve3.XAxis = xAxisOuter;
            curve3.YAxis = yAxisOuter;
            // Other alyout options to try:
            //plotMultipleAxes.Axes.EqualAxes = new AxisPair(plot1.Axes.XAxes.Bottom, plot1.Axes.YAxes.Left);
            //plotMultipleAxes.Axes.SetAxesEqual();
            //plotMultipleAxes.Axes.Height = 100;
            //plotMultipleAxes.Axes.Width = 500;
            //plotMultipleAxes.Axes.MinAxisMargin = new Thickness(200, 0, 0, 0);
            plotMultipleAxes.Axes.XAxes.Top.TickLength  = 5;
            plotMultipleAxes.Axes.YAxes.Left.TickLength = 5;


            xAxisOuter.Min      = 6.5e-5;
            xAxisOuter.Max      = 7.3e-3;
            xAxisOuter.AxisType = AxisType.Log;
            plotMultipleAxes.Children.Add(new Plot2DCurve(new Curve(new double[] { 0.01, 10 }, new double[] { 5, 6 }))
            {
                XAxis = xAxisOuter
            });
            plotMultipleAxes.UseDirect2D = false;
        }