我想用我的数据的 csplines 插值绘制一个二维图,在 y 轴上有一个自变量。插值函数应为 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
如果你想要更高的分辨率,你可以使用
set samples
在绘制到表格之前。
关于plot - gnuplot - 平滑插值 x=f(y),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25526542/