Accord.Statistics.Visualizations.Scatterplot.Compute C# (CSharp) Method

Compute() public method

Computes the scatter plot.
public Compute ( double x, double y, int labels ) : void
x double Array of X values.
y double Array of corresponding Y values.
labels int Array of integer labels defining a class for each (x,y) pair.
return void
        public void Compute(double[] x, double[] y, int[] labels)
        {
            if (x == null)
                throw new ArgumentNullException("x");

            if (y == null)
                throw new ArgumentNullException("y");

            if (labels == null)
                throw new ArgumentNullException("labels");

            if (x.Length != y.Length)
                throw new DimensionMismatchException("y", "The x and y arrays should have the same length");

            if (x.Length != labels.Length)
                throw new DimensionMismatchException("labels",
                    "The labels array should have the same length as the data array.");

            initialize(x, y, labels);
        }

Same methods

Scatterplot::Compute ( double values ) : void
Scatterplot::Compute ( double x, double y ) : void
Scatterplot::Compute ( double data, int labels ) : void

Usage Example

        public void ComputeTest2()
        {
            ScatterplotView target = new ScatterplotView();

            Scatterplot histogram = new Scatterplot();
            histogram.Compute(new double[] { 200.0, 200.0, 200.0 });

            target.DataSource = null;

            target.DataSource = histogram;

            target.DataSource = null;

            // ScatterplotBox.Show(histogram);
        }
All Usage Examples Of Accord.Statistics.Visualizations.Scatterplot::Compute