You are not logged in.

1

Sunday, March 7th 2010, 1:23pm

Strange Interpolation in Qwt3dPlots Surface Plots



Quoted

Hi,

I'm trying to plot a simple surface plot in 3D. I don't understand the interpolation, because:

For these data, being (x, y, z) the colums of the tabla matrix.


Qt Code:
Switch view

  1. tabla[0][0]= 10;

  2. tabla[0][1]= -50;

  3. tabla[0][2]= 500;

  4. tabla[1][0]= 10;

  5. tabla[1][1]= -60;

  6. tabla[1][2]= 500;

  7. tabla[2][0]= 30;

  8. tabla[2][1]= -50;

  9. tabla[2][2]= 500;

  10. tabla[3][0]= 30;

  11. tabla[3][1]= -60;

  12. tabla[3][2]= 500;



then I call the function to plot




m_3dPlot->loadFromData(tabla, 3, 4, 10, 30 , -60,-50 ); //being 3 = colums, 4= rows, 10 = minX, 30 = maxX, -60 = minY, -50= maxY




The graph is attached.


It is shown that, for the values in Y axis, thera are oscillation. For example, for any vaule of X and Y = -60, Z should be 500, but it is 0.

And then the Z value decreases for an Y value arround -58, and then increases to get 500 for a Y value arround -54. And then it decreases again to 0 in Y = -50.

Z value should be always 500, because of every Z data inserted is 500 (at any Y and X value). So the interpolation must result also Z=500, but instead, the Z value increases and decreases in a strange way.

Has someone any idea? The values must be sorted? If yes, wich is the criteria (sorted by X values or Y, or Z).
locke has attached the following image:
  • Graph.jpg

Rate this thread