plotsurfacescilab

How to draw a surface from scattered data in Scilab?


How can I plot such a thing shown in the Fig with Scilab.

Sample photo here

For example, There is a value of coupling loss at the location of (X,Y). So, there is a certain Z value for each (X, Y) points but the value is not a function of this (X,Y).

Any help is appreciated.

I expect it to be look exactly like in this figure, or 3D surface plot as.


Solution

  • For unstructured data like this one (z as an unknown function of scattered (x,y) data) the only way is to use a triangulation of (x,y) data and plot resulting triangles in the 3d space, like in this example

    x=rand(50,1);
    y=rand(50,1);
    z=rand(50,1);
    tri = mesh2d(x, y);
    gcf().color_map=parulacolormap(128);
    plot3d1(x(tri),y(tri),z(tri));
    gce().hiddencolor=0;
    

    enter image description here