public static void Main(string[] args) { var py = new PyPlotInterface(true,true); var labels = new PlotDecorators(); labels.Title = "Test of single plot"; labels.XLabel = "X"; labels.YLabel = "Y"; var Plot = py.MakePlotFunction(labels, PyPlotInterface.AxesStyle.dark); labels.Title = "Test of histogram plot"; labels.YLims = new Tuple<double, double>(0, 1.1); var Hist = py.MakeHistFunction(labels,true,true); labels.Title = "Test of series plot"; labels.YLims = new Tuple<double, double>(-5, 5); labels.ColorCycle = new List<PlotColor>(); labels.ColorCycle.Add(new PlotColor(0.7, 0.4, 0.7)); labels.ColorCycle.Add(new PlotColor()); labels.ColorCycle.Add(new PlotColor(0.7, 0.7, 0.3)); var PlotMulti = py.MakeSeriesPlotFunction(labels); //create our plot data int dataSize = 5000; double[] x = new double[dataSize]; double[] y = new double[dataSize]; double[] y2 = new double[dataSize]; double[] y3 = new double[dataSize]; for (int i = 0; i < dataSize; i++) { x[i] = 10.0 / dataSize * i; y[i] = Math.Sin(x[i]); y2[i] = Math.Cos(x[i]); y3[i] = Math.Tan(x[i]); } List<double[]> X = new List<double[]>(); X.Add(x); X.Add(y); X.Add(x); X.Add(x); List<double[]> Y = new List<double[]>(); Y.Add(y); Y.Add(y2); Y.Add(y2); Y.Add(y3); Console.WriteLine("Plotting"); PlotMulti(X, Y); Plot(y, x); string f3 = Hist(y, 20); Console.WriteLine("Press return to close figure 3"); Console.ReadLine(); py.CloseFigure(f3); Console.WriteLine("Press return to close remaining figures"); Console.ReadLine(); py.CloseAllFigures(); py.Dispose(); Console.WriteLine("Press return to exit"); Console.ReadLine(); }
public static void Main(string[] args) { var py = new PyPlotInterface(true, true); var labels = new PlotDecorators(); labels.Title = "Test of single plot"; labels.XLabel = "X"; labels.YLabel = "Y"; var Plot = py.MakePlotFunction(labels, PyPlotInterface.AxesStyle.dark); labels.Title = "Test of histogram plot"; labels.YLims = new Tuple <double, double>(0, 1.1); var Hist = py.MakeHistFunction(labels, true, true); labels.Title = "Test of series plot"; labels.YLims = new Tuple <double, double>(-5, 5); labels.ColorCycle = new List <PlotColor>(); labels.ColorCycle.Add(new PlotColor(0.7, 0.4, 0.7)); labels.ColorCycle.Add(new PlotColor()); labels.ColorCycle.Add(new PlotColor(0.7, 0.7, 0.3)); var PlotMulti = py.MakeSeriesPlotFunction(labels); //create our plot data int dataSize = 5000; double[] x = new double[dataSize]; double[] y = new double[dataSize]; double[] y2 = new double[dataSize]; double[] y3 = new double[dataSize]; for (int i = 0; i < dataSize; i++) { x[i] = 10.0 / dataSize * i; y[i] = Math.Sin(x[i]); y2[i] = Math.Cos(x[i]); y3[i] = Math.Tan(x[i]); } List <double[]> X = new List <double[]>(); X.Add(x); X.Add(y); X.Add(x); X.Add(x); List <double[]> Y = new List <double[]>(); Y.Add(y); Y.Add(y2); Y.Add(y2); Y.Add(y3); Console.WriteLine("Plotting"); PlotMulti(X, Y); Plot(y, x); string f3 = Hist(y, 20); Console.WriteLine("Press return to close figure 3"); Console.ReadLine(); py.CloseFigure(f3); Console.WriteLine("Press return to close remaining figures"); Console.ReadLine(); py.CloseAllFigures(); py.Dispose(); Console.WriteLine("Press return to exit"); Console.ReadLine(); }