2014-08-27 90 views
4

我想繪製與我的數據的內插csplines一個二維曲線圖與Y軸的獨立變量。插值函數應該是x = f(y)形式。有沒有辦法做到這一點,而不切換軸?gnuplot的 - 平滑插值X = F(y)的

gnuplot的:

set terminal svg size 400,300 enhanced fname 'arial' fsize 10 butt solid 
set output 'out.svg' 
set xrange [10:13] 
plot "data.txt" using 2:1 notitle #smooth csplines 

數據:

1 11.45294118 
2 11.43529412 
3 11.18823529 
4 10.98235294 
5 10.94117647 
6 11.28823529 
7 11.27058824 

回答

4

可以使用table作爲中間文件,然後執行通常的方式插補:

set table "data2.txt" 
plot "data.txt" using 1:2 notitle smooth csplines 
unset table 
set xrange [10:13] 
plot "data2.txt" using 2:1 w l notitle 

enter image description here

如果你想要更高的分辨率,你可以在繪製表格之前使用set samples

+1

這個時候你快:) +1。是的,這是唯一的工作的選擇,因爲對於'csplines'的數據被首先進行在第一座標單調的,這將導致不同的結果與使用'1:2'和'使用2:1'(爲了比較,使用'平滑bezier'可以直接使用'plot「data.txt」使用2:1平滑貝塞爾「,但是插值方法是不同的;) – Christoph 2014-08-27 13:21:59