1
votes

I have a data file with x, y, and z datums--basically x,y locations with z representing attenuation at that location.

The answer to a question like Line plot in GnuPlot where line color is a third column in my data file? using palette defined (with palette z) is very close, except that each line segment is set to a single color along its length.

Is there a way to have the Z value interpolated (linear is fine) along each segment, so the attenuation values are a smooth gradient rather than jumping values at each segment boundary?

1

1 Answers

3
votes

You can use set dgrid3d to interpolate a given data set. Consider the data file test.dat with the content

1 2 1
2 3 2
1 1 2

Plot this with

set dgrid3d 30,30 splines
set ticslevel 0
set hidden3d
splot 'test.dat' matrix w l lc palette lw 3

to get

enter image description here

If this works also in your case depends on several other factors, like number of data points or if you don't want to create a new grid, but retain the original grid, and only smooth the colors. In the latter case you must write an external script to prepare your data in an appropriate way.