0

我以前看过数据的 3d 曲面图,但我不知道我可以使用什么软件来制作它。

我有 3 系列数据(X、Y、Z),基本上我希望表上的每一行都是 3d 空间中的一个点,全部连接为一个网格。数据目前是 csv,但我可以更改格式,因为它是我自己生成的数据。

谁能帮忙

4

3 回答 3

5

如果您的 x 和 y 点在拓扑上位于网格上,则可以使用 MESH。它们不需要均匀的间距;它们只需要组织起来,以便 x(r:r+1,c:c+1) 和 y(r:r+1,c:c+1) 在网格上为每一行 r 和每一列定义一个四边形C。

如果您的数据不在网格上,但您知道面应该是什么,请查看 PATCH 函数。

如果只有点,对曲面一无所知,则需要先解决曲面重建问题。我用过椰子;那里也有其他不错的包裹。一旦你有了重建的表面,你就可以使用 PATCH 来显示它。

于 2008-11-06T00:34:30.543 回答
1

你看过使用vtk吗?如果您有 Matlab,那么您应该能够使用plot3dsurfmeshgridgriddata生成 3D 曲面图或补丁,如Fooz 先生所建议的那样。

于 2008-11-05T23:42:40.880 回答
0

gnuplot 或scilab

下面是我不久前为 SciLab 编写的脚本。它读取由制表符分隔的三列。您可以轻松更改此设置以满足您的需求,非常不言自明。这是在 scilab 中读/写的快速指南,我在下面参考的是这里

function plot_from_file(datafile)
//
// Make a simple x-y-z plot based on values read from a datafile.
// We assume that the datafile has three columns of floating-point
// values seperated by tabs.

  // set verbose = 1 to see lots of diagnostics
  verbose = 1;

  // open the datafile (quit if we can't)
  fid = mopen(datafile, 'r');
  if (fid == -1) 
    error('cannot open datafile');
  end

  // loop over all lines in the file, reading them one at a time
  num_lines = 0;
  while (true)

    // try to read the line ...
    [num_read, val(1), val(2), val(3)] = mfscanf(fid, "%f\t%f\t%f");
    if (num_read <= 0)
      break
    end
    if (verbose > 0)
      fprintf(1, 'num_lines %3d  num_read %4d \n', num_lines, num_read);
    end
    if (num_read ~= 3) 
      error('didn''t read three points');
    end

    // okay, that line contained valid data.  Store in arrays
    num_lines = num_lines + 1;
    x_array(num_lines) = val(1);
    y_array(num_lines) = val(2);
    z_array(num_lines) = val(3);
  end

  // now, make the plot
  plot3d2(x_array, y_array, z_array);
  // close the datafile
  mclose(fid);

endfunction
于 2008-11-05T23:44:12.593 回答