3軸グラフをメッシュとしてプロットします
質問
以前にデータの3D表面プロットを見たことがありますが、作成に使用できるソフトウェアがわかりません。
3系列のデータ(X、Y、Z)があります。基本的には、テーブルの各行を3D空間のポイントにして、すべてメッシュとして結合します。データは現在csvですが、自分で生成したデータなので、形式を変更できます。
誰でも助けることができます
解決
xとamp; yポイントがトポロジ的にグリッド上にある場合、MESHを使用できます。等間隔にする必要はありません。 x(r:r + 1、c:c + 1)とy(r:r + 1、c:c + 1)がメッシュの四辺形を定義するように、行rと列ごとに整理する必要があります。 c。
データがグリッド上にないが、顔がどうあるべきかわかっている場合は、PATCH関数を見てください。
ポイントしかなく、表面について何も知らない場合は、まず表面再構成の問題。 coconeを使用しました。他にも良いパッケージがあります。再構築されたサーフェスが得られたら、PATCHを使用して表示できます。
他のヒント
vtk の使用を検討しましたか? Matlabをお持ちの場合、 psh3d または surf と meshgrid および griddata を使用して3Dサーフェスを生成できるはずです。 氏によって提案されたプロットまたはパッチ 。 Fooz 。
gnuplotまたは scilab
Belowは、私がしばらく前に書いた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
所属していません StackOverflow