gnuplot的 - 平滑插值X = F(y)的

问题描述:

我想绘制与我的数据的内插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 

可以使用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