-1

i would like to access to the coordinate information in a LinePlot, i wanto to use the Property LinePlot.Positions as show in the following code:

using System;
using System.Collections.Generic;
using System.Text;
using ILNumerics.Data;
using ILNumerics.Drawing.Plotting;
using ILNumerics.Drawing;
using ILNumerics;
using static ILNumerics.ILMath;
using System.Linq;

namespace TestConsoleUI2
{
    class Program
    {
        static void Main(string[] args)

         {
            Array<double> xx = linspace(10, 15, 5);
            Array<double> yy = linspace(8, 90, 5);

            LinePlot myLinePlot = new LinePlot(xx, yy);

            RetArray<float> p = myLinePlot.Positions;

          }
    }
}

Nevertheless i got an System.NullReferenceException i have debugged and the data exists at that moment, can anyone help me?

Regards

DonMiguelSanchez
  • 376
  • 3
  • 15
  • 1
    Can you create [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example)? – Prasad Telkikar Aug 18 '20 at 12:27
  • From that single line of code, it is impossible to find the cause of your problem. Either dividedDataSets or LinePlot is null. Or if they are properties, some object that is used in the getter is null. – SomeBody Aug 18 '20 at 12:33
  • sorry i just wanted to keep it simple, i just tested the edit coded and still bring the Exception @PrasadTelkikar SomeBody – DonMiguelSanchez Aug 18 '20 at 13:17

1 Answers1

-1

After try and error i found the solution that is working for me.

using System;
using System.Collections.Generic;
using System.Text;
using ILNumerics.Data;
using ILNumerics.Drawing.Plotting;
using ILNumerics.Drawing;
using ILNumerics;
using static ILNumerics.ILMath;
using System.Linq;

namespace TestConsoleUI2
{
    class Program
    {
        static void Main(string[] args)

         {
            Array<double> xx = linspace(10, 15, 5);
            Array<double> yy = linspace(8, 90, 5);

            LinePlot myLinePlot = new LinePlot(xx, yy);

            PositionsBuffer p = myLinePlot.Line.Positions;

          }
    }
}

DonMiguelSanchez
  • 376
  • 3
  • 15