Search code examples
arraysplot3daxisilnumerics

Plot 3D with specific x and y ILNumerics


I have a 3D array, I want to plot it as a surface in ILNumerics. Here is my code:

        ILArray<float> plot = ILMath.tosingle(hasil);
        var scene = new ILScene();
        ILColormap cm = new ILColormap(Colormaps.Jet);
        ILArray<float> data = cm.Data;

        scene.Add(
            new ILPlotCube(twoDMode: false){
                new ILSurface(plot[":;:;2"]){

                    Wireframe = { Color = Color.FromArgb(50, Color.LightGray)},
                    Colormap = new ILColormap(data),
                    Children = { new ILColorbar()}
                }

            }
        );

        ilPanel1.Scene = scene;

And here is the result: surface plot created with ILNumerics

Actually my array includes the x posisition (plot[":;:;0"]) and y position (plot[":;:;1"]). How to use that for ILSurface in order to get the correct grid positions and value? Rather than indexed value in the range 0-100?


Solution

  • Well, it was simply. I already got the answer.

    new ILSurface(plot[":;:;2"],plot[":;:;0"],plot[":;:;1"])