2014-09-30 122 views
2

如何平滑以x(y)形式呈現的數據? Gnuplot平滑功能對無效句柄等情況。Gnuplot x(y)平滑


作爲一個例子:

文件(T-L.dat):

0.00 0.0 
0.10 0.1 
0.15 0.2 
0.40 0.3 
0.60 0.4 
0.50 0.5 
0.60 0.6 
0.40 0.7 
0.15 0.8 
0.10 0.9 
0.00 1.0 

What I want

gnuplot的會議:

[email protected]:~/MEAS/HEAT$ gnuplot 

     G N U P L O T 
     Version 4.6 patchlevel 4 last modified 2013-10-02 
     Build System: Linux x86_64 

     Copyright (C) 1986-1993, 1998, 2004, 2007-2013 
     Thomas Williams, Colin Kelley and many others 

     gnuplot home:  http://www.gnuplot.info 
     faq, bugs, etc: type "help FAQ" 
     immediate help: type "help" (plot window: hit 'h') 

Terminal type set to 'wxt' 
gnuplot> plot "T-L.dat" with lines 

What I have

添加平滑:

gnuplot> plot "T-L.dat" with lines smooth csplines 

結果不好過(只有2個鏈接,抱歉)。

其他功能也沒有給我想要的結果。 但我真的需要一個樣條。

+0

可否請你在問一個問題投入更多的時間?你是否想將一個拋物線擬合到一組數據點,還是隻想繪製拋物線?那麼你的代碼的哪部分不起作用? – Christoph 2014-09-30 18:21:42

+0

[結果不好](https://yadi.sk/i/UE3k8hvEbkQUR) – knkd 2014-09-30 20:09:20

回答

3

正確,gnuplot可以使用僅樣條線數據形式y(x)平滑。爲此,數據在平滑之前在x中呈現單調。你的數據相對於y是對稱的,這就是爲什麼你得到一條直線作爲平滑的結果。

爲了使您的數據相對於y平滑,您必須先交換座標軸並將平滑結果保存到臨時文件中。這是然後用正確的軸選擇畫在:

set table 'T-L-smoothed.dat' 
plot 'T-L.dat' using 2:1 smooth csplines 
unset table 
plot 'T-L-smoothed.dat' using 2:1 with lines, 'T-L.dat' with points pt 7 

enter image description here