1

I am trying to plot a 3D plot from somewhat weird data. Assume you have a function F(T,V) = a*T + b*V + c*V**2, but those parameters in fact change for every T. So my data file looks like this:

#T a b c
0 a1 b1 c1
1 a2 b2 c2
2 a3 b3 c3
...

(So, essentially, my function is parametrized in temperature T and volume V. But for every T that parametrization changes)

What I want to do is to plot this data, for example, but not necessarily, in a fenceplot like this.

My best attempt of achiving this is

F1(T,V) = T
F2(T,V) = V
F3(T,V) = V**2

set yrange [3:4]

splot infile u 1:y:($2*F1(x,y) + $3*F2(x,y) + $4*F3(x,y))

which is terribly wrong in numerous places, but should show best what I want to do...

NoBullsh1t
  • 483
  • 4
  • 14

1 Answers1

0

If I correctly understood your question, my suggestion would be the following. The x-range is V. And T, a, b, and c are taken from your datafile. In this case it is of advantage if you have your data in a datablock. In case you have it in a file, see here: gnuplot: load datafile 1:1 into datablock

Depending on your data loop your data lines forward or reverse (here reverse: for [i=|$Data|:1:-1]) for not fully covering some other curve. Note that there is no headerline in the datablock, otherwise you would have to loop from [i=|$Data|:2:-1]. Check the following minimal example for further tuning...

Code:

### parametric plot with zerrorfill
reset session

#T    a    b     c
$Data <<EOD
 0  1.1  2.1  0.1
 1  1.2  2.2  0.2
 2  1.3  2.3  0.3
 3  1.4  2.4  0.4
 4  1.5  2.5  0.5
 5  1.6  2.6  0.6
EOD

T(i) = real(word($Data[i],1))
a(i) = real(word($Data[i],2))
b(i) = real(word($Data[i],3))
c(i) = real(word($Data[i],4))
F(i,V) = a(i)*T(i) + b(i)*V + c(i)*V**2

set xyplane relative 0
set xrange [0:20]

splot for [i=|$Data|:1:-1] '+' u 1:(T(i)):(0):(0):(F(i,$1)) with zerrorfill notitle
### end of code

Result:

enter image description here

theozh
  • 22,244
  • 5
  • 28
  • 72
  • Thanks! Lot's of new gnuplot concepts to learn here, but it does nicely what I asked. Now I have to make sense of my data ;) – NoBullsh1t Mar 03 '21 at 09:35