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
Data:
1 11.45294118
2 11.43529412
3 11.18823529
4 10.98235294
5 10.94117647
6 11.28823529
7 11.27058824
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
If you want higher resolution you can use set samples
before plotting to the table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With