我以前见过数据的3d曲面图,但我不知道我可以用什么软件来制作它。
我有3个系列的数据(X,Y,Z),基本上我希望表中的每一行都是3d空间中的一个点,所有这些行都连接成一个网格。数据目前是csv格式,但我可以更改格式,因为它是我自己生成的数据。
有人能帮上忙吗
发布于 2008-11-06 00:34:31
如果你的x&y点在拓扑上位于网格上,那么你可以使用网格。它们不需要具有均匀的间距;它们只需要进行组织,以便x(r:r+1,c:c+1)和y(r:r+1,c:c+1)在网格上为每行r和列c定义一个四边形。
如果您的数据不在网格上,但您知道面应该是什么,请查看PATCH函数。
如果只有点,而对曲面一无所知,则需要首先解决surface reconstruction问题。我用过cocone;还有其他不错的包。一旦你有了重建的表面,然后你可以使用面片来显示它。
发布于 2008-11-05 23:42:41
你有没有考虑过使用vtk?如果您有Matlab,那么您应该能够使用plot3d或surf与网格和网格数据一起生成Mr. Fooz建议的3D曲面图或面片。
发布于 2008-11-05 23:44:13
gnuplot或scilab
下面是我前段时间写的SciLab脚本。它以制表符分隔的三列进行读取。你可以很容易地改变它来满足你的需求,这是非常不言自明的。下面是reading/writing in scilab的快速指南,我在下面引用的是here
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);
endfunctionhttps://stackoverflow.com/questions/267151
复制相似问题