1

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 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Is there any way to get dgrid3d's interpolation of z, but applied to an output which looks more like "plot 'test.dat' w l lc palette z"?
Sorry, but I don't know what you mean.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.