製圖 - Linux

Table of Contents

※ 引述《kzgiant (嘟嘟)》之銘言:
: 有很大量的資料要畫成圖表
: 用openoffice貼好,再做成表格會累死。
: 輸入資料
: date.txt
: 0 0 0 0 0 0
: 0 1 1 1 1 0
: 0 1 1 2 1 0
: 0 1 2 2 2 1
: 0 1 1 1 1 1
: 0 0 0 0 0 0
: 有程式 可以直接吃整個份資料
: 畫出3D的曲面圖嗎?
: gnuplot能畫曲面圖嗎?
: 謝謝
gnuplot要畫成3D的曲面圖...

不知道你指的是不是這個像是這樣的:

http://gnuplot.sourceforge.net/demo_4.2/surface1.html

(不過上述的Demo都是用公式去畫出來的。)

如果是這種3D 的surface圖的話。

可以在進入gnuplot之後試試下列的方法:

資料類型為Matrix:(就是上面你給的data.txt)

splot 'data.txt' matrix with lines

這個時候你就會看到圖出來了,然而x-axis 和 y-axis卻則無任何意義.

如果要調整x-axis和y-axis的單位的話

set xtics ("100" 0, "200" 1, "300" 2)

在x軸線上的第一個值定為100,第二個值定為200....以此類推

set ytics ("100" 0, "200" 1, "300" 2)

之後再

replot

圖就出來了。

如果覺得這樣畫出來的圖沒有顏色,可以再加個指令

set pm3d

replot

這個時候會變得炫一點。

以上的gnuplot細節可以參考這個網站:

http://t16web.lanl.gov/Kawano/gnuplot/datafile-e.html#matrix

http://t16web.lanl.gov/Kawano/gnuplot/plotpm3d-e.html#6.7OD

--

All Comments

Liam avatarLiam2010-01-07
對了,我是在gnuplot4.2版下面試的。
Mason avatarMason2010-01-11
matrix應該能批次畫圖了 謝謝