gnuplot-平滑插值x = f(y) [英] gnuplot - smooth interpolation x=f(y)
本文介绍了gnuplot-平滑插值x = f(y)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在y轴上使用自变量对csplines插值数据绘制2D图形.插值函数应采用x = f(y)的形式.有没有不用切换轴就可以做到这一点的方法?
I would like to plot a 2D graph with csplines interpolation of my data with an independent variable on y axis. The interpolating function should be in x = f(y) form. Is there any way to do this without switching axes?
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
用作中间文件,并按常规方式进行插值:
You can use a table
as an intermediate file and do the interpolation in the usual way:
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
.
If you want higher resolution you can use set samples
before plotting to the table.
这篇关于gnuplot-平滑插值x = f(y)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文