あなたが何をしたいのか正確に理解するのに苦労していますが、うまくいけば以下が役に立ちます。
データファイル ( test.dat
)があるとします。
NaN NaN NaN NaN NaN NaN NaN 100 200
NaN NaN NaN NaN NaN NaN 100 200 100
NaN NaN NaN NaN NaN 100 200 100 NaN
NaN NaN NaN NaN 100 200 100 NaN NaN
NaN NaN NaN 100 200 100 NaN NaN NaN
NaN NaN 100 200 100 NaN NaN NaN NaN
NaN 100 200 100 NaN NaN NaN NaN NaN
100 200 100 NaN NaN NaN NaN NaN NaN
200 100 NaN NaN NaN NaN NaN NaN NaN
以下を使用して、このデータファイルをプロットできます。
set datafile missing 'NaN'
set style data lines
splot 'test.dat' matrix #matrix allows our datafile to look like your first data grid
あなたが何を望んでいるかを正しく理解している場合、データを「グリッド」形式にしない限り(マトリックスを使用するか、「スキャンセパレーター」を使用して(以下を参照))それを達成することはできません dgrid3d
。データの断片を欠落として指定する方法 フォーマットを使用したくない場合はmatrix
、次のことができます。
#Note the blank spaces!
#Each block doesn't have to have the same number of lines
#but the resulting plot looks nicest if it does.
#for lines that you want to make blank, use some character to
#mark that data as missing. (I used 'NaN' above, but you can
#use anything you want. sometimes I use '?' too).
x1 y1 num
x1 y2 num
x1 y3 num
...
x2 y1 num
x2 y2 num
x2 y3 num
...
...
xN y1 num
xN y2 num
xN y3 num
...
具体的な例として: グリッドの場合:
1 1 ?
1 2 ?
1 3 24
1 4 25
2 1 ?
2 2 23
2 3 24
2 4 25
3 1 23
3 2 23
3 3 24
3 4 ?
4 1 24
4 2 24
4 3 ?
4 4 ?
その後:
set datafile missing '?'
set style data lines
splot 'my_data.txt' #Not matrix this time.
もちろん、この解像度のデータでは、プロットは希望どおりに表示されない可能性がありますが、うまくいけばそれが要点を示しています。
編集
投稿の上部に表示されている形式でデータファイルを取得できる場合は、いくつかの (追加の) オプションがあります (ゼロを台無しにすることはありません)。
set datafile missing '0' #This just has the effect of removing the 0 values from the plot
splot 'myfile.txt' matrix
または:
set zrange [0.5:] #This also removes the 0 values, but alters the z-range.
splot 'myfile.txt' matrix