0
votes

I am currently plotting multiple 2D (x,y) datafiles in a gnuplot fence plot.

I've created a list with all the files

list='file1.dat file2.dat file3.dat'

adding the z value for the 3rd axis in this way

z_index='1 2 3'

then I'm able to plot so that each datafile corresponds a different z values

splot for [i=1:words(list)] word(list,i) u (real(word(z_index,i))):($1):($2) w l

see the plot

However, I would like to do the same using zerrorfill with transparency instead, as filledcurve does not permit me to do it in a straightforward way.

I know from the manual that A fence plot is generated by splot with zerrorfill using input columns i y z_base z_base Fi(y), but I don't understand how to transport my code to fullfill the zerrorfill syntax.

Any solution? Pls commenting the code would be kindly appreciated!

1

1 Answers

0
votes

If your gnuplot is new enough to have plot style 'zerrorfill' then it is also new enough to use arrays. I suggest that using arrays for the file name and the y (not z) index is easier to read than using "word(string,i)".

You don't explain exactly what y values are in your 2D data files. I will assume a single y value in column 2 and a fence plot that fills the area between y=0 and y=column(2) except that for the 3D plot we will use this for z rather than y.

array file[3] = ["file1.dat", "file2.dat", "file3.dat"]
array y_index[3] = [1, 2, 3]
set zrange [0:*]
set xyplane 0

splot for [k=1:3] file[k] using 1:(y_index[k]):2:(0):2 with zerrorfill \
      linetype k fillstyle transparent solid 0.5