1

I have three 2D-arrays that all have same X and Y coordinates but different values. Each of these arrays represent a temperature of a room in certain height (eg. array1 = 10m, array2 = 5m, array3= 3m).

I have created a ILPlotCube that has three different ILContourPlots for these arrays but all of them get positioned to same Z-axis spot of cube (0):

this.scene = new ILScene();
ILPlotCube pc = new ILPlotCube(twoDMode: false);

ILArray<float> TA = tempRoom.GetILArray("TA");
ILContourPlot cpa = new ILContourPlot(TA, create3D: false);
ILArray<float> TB = tempRoom.GetILArray("TB");
ILContourPlot cpb = new ILContourPlot(TB, create3D: false);
ILArray<float> TC = tempRoom.GetILArray("TC");
ILContourPlot cpc = new ILContourPlot(TC, create3D: false);

pc.Add(cpa);
pc.Add(cpb);
pc.Add(cpc);

scene.Add(pc);

ilPanel1.Scene = this.scene;
ilPanel1.Refresh(); 

Image of result: https://i.stack.imgur.com/VNLgB.jpg

How can I set manually range of the Z-axis of cube shown in picture and manually set Z-axis-position of each ILContourPlot without messing up contours in ILContourPlots?

skutzi
  • 77
  • 6

1 Answers1

1

Contour plots in ILNumerics are regular scene graph objects - just like evey other plot. You can transform them in arbitray ways using regular group objects:

ILArray<float> A = ILMath.tosingle(ILSpecialData.terrain); 
ilPanel1.Scene.Add(new ILPlotCube(twoDMode: false) {
    new ILGroup(translate: new Vector3(0,0,10)) {
        new ILContourPlot(A["0:50;0:50"]) 
    },
    new ILGroup(translate: new Vector3(0,0,5)) {
        new ILContourPlot(A["50:100;50:100"],lineWidth: 3)
    },
    new ILGroup(translate: new Vector3(0,0,3)) {
        new ILContourPlot(A["150:200;150:200"])
    }
}); 

Gives:

Contour Plots ILNumerics stacked

But if you use it in a 2D setup it gets confusing quickly. Obviously you have to use the configuration options for lines and contour levels in order to distinguish individual contour plots. Or use a 3D view.

user492238
  • 4,094
  • 1
  • 20
  • 26