public static void QuickPlot(double[] x, double[] y, 
     Tuple<double, double> xRange = null, Tuple<double, double> yRange = null)
 {
     PlotHelper.Dispatcher.Invoke(() =>
     {
         var window = new Window()
         {
             Width = 640,
             Height = 480
         };
         var plotControl = new PlotControl();
         plotControl.AddLine(
             x.Zip(y, (a, b) => new OxyPlot.DataPoint(a, b))
             .ToArray());
         if (xRange != null)
         {
             var xAxis = plotControl.Plot.Axes.First();
             xAxis.Minimum = xRange.Item1;
             xAxis.Maximum = xRange.Item2;
         }
         window.Content = plotControl;
         window.Title = "Plot Window";
         window.Show();
         window.Focus();
         window.BringIntoView();
         window.InvalidateVisual();
     });
 }
Esempio n. 2
0
 public static void QuickPlot(double[] x, double[] y,
                              Tuple <double, double> xRange = null, Tuple <double, double> yRange = null)
 {
     PlotHelper.Dispatcher.Invoke(() =>
     {
         var window = new Window()
         {
             Width  = 640,
             Height = 480
         };
         var plotControl = new PlotControl();
         plotControl.AddLine(
             x.Zip(y, (a, b) => new OxyPlot.DataPoint(a, b))
             .ToArray());
         if (xRange != null)
         {
             var xAxis     = plotControl.Plot.Axes.First();
             xAxis.Minimum = xRange.Item1;
             xAxis.Maximum = xRange.Item2;
         }
         window.Content = plotControl;
         window.Title   = "Plot Window";
         window.Show();
         window.Focus();
         window.BringIntoView();
         window.InvalidateVisual();
     });
 }