title: Plot 3d surface with ILnumerics and c#
body: <p>I have used this code:</p>
  
  <pre><code>    private void ilPanel1_Load(object sender, EventArgs e)
      {    using (ILScope.Enter())
          {
              ILArray&lt;float&gt; X = new float[] { 0, 0, 1, 1, 2.5F, -2.6F, 5, 9, 1, 38 };
              ILArray&lt;float&gt; Y = new float[] { 1, 0, 1, 0, 1.5F,  0.5F, 5, 9, 1, 39 };
              ILArray&lt;float&gt; Z = new float[] { 0, 0, 1, 1, 0.4F, -0.2F, 5, 9, 1, 39 };
              X = X.Reshape(2,5);
              Y = Y.Reshape(2,5);
              Z = Z.Reshape(2,5);
              ilPanel1.Scene.Add(new ILPlotCube(twoDMode: false) {
                  new ILSurface(Z, colormap: Colormaps.Cool) {
                      Colors = 1.4f  ,Children = { new ILColorbar() }
                  }
              });
          }
      }
  </code></pre>
  
  <p>This produces:  </p>
  
  <p><img src="https://i.stack.imgur.com/v09zM.png" alt="enter image description here"></p>
  
  <p>However I checked <a href="https://stackoverflow.com/questions/18830352/ilnumerics-drawing-a-surface-having-x-y-z-coordinates">this question</a> and tried to adapt deprecated <a href="http://ilnumerics.net/forum/index.php?p=/discussion/163/how-to-plot-a-3d-surface-/p1" rel="nofollow noreferrer">ILnumerics solution</a> (as I did not find other c# code), but still do not get it, every coordinate (Z,X and Y) corresponds to one slice (m x n) in the array. So it is necesarry to reshape data. </p>
  
  <p>this part is the problem:</p>
  
  <pre><code>            X = X.Reshape(2,5);
              Y = Y.Reshape(2,5);
              Z = Z.Reshape(2,5);
  </code></pre>
  
  <p>If I do not give correct size, program fails, so in example I have 10 elements on each vector, so when resahping I would put 2,5 which multiplied are 10?...</p>
  
  <p>What about case I have 11 elements as if I put 2,5 on reshape I get error?</p>
  
  <p>What to do?</p>
  
  <p>I have tried using <code>X = X.Reshape(11);</code> but It fails... if I use <code>X = X.Reshape(10);</code> it just do not draw anything</p>