以前にデータの 3D サーフェス プロットを見たことがありますが、それを作成するためにどのソフトウェアを使用できるかわかりません。
私は 3 つの一連のデータ (X、Y、Z) を持っています。基本的には、テーブルの各行を 3D 空間の点にし、すべてメッシュとして結合したいと考えています。データは現在csvですが、自分で生成したデータなのでフォーマットを変更できます。
誰でも助けてくれますか
x & y ポイントがトポロジ的にグリッド上にある場合は、MESH を使用できます。等間隔である必要はありません。x(r:r+1,c:c+1) と y(r:r+1,c:c+1) が各行 r と列に対してメッシュ上の四角形を定義するように整理する必要があるだけですc.
データがグリッド上にない場合でも、面がどうあるべきかはわかっている場合は、PATCH 関数を見てください。
ポイントしかなく、サーフェスについて何も知らない場合は、最初にサーフェス再構築の問題を解決する必要があります。ココネを使用しました。他にも良いパッケージがあります。再構築されたサーフェスを取得したら、PATCH を使用して表示できます。
gnuplot またはscilab
以下は、私がしばらく前に書いた SciLab のスクリプトです。タブで区切られた 3 つの列で表示されます。これは、ニーズに合わせて簡単に変更できます。これは、 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