How to interpolate xyz and value (long,lat,depth, value) and get slice at different depth

Dear GMT community.

I am using GMT for my research a while ago but does not familiar to tackle this problem.
I have a text file that contains 4 columns(long, lat, depth, and values) at regular intervals.
Is it possible to make a 3D grid w.r.t 4 columns and later extract the values and plot at a specific depth?
below images will be an ideal solution but I could not get it with xyz2grid.

Thank you very much

Until we get xyz2grd to make a cube directly, the workaround is for you to make one 2-D grid for each depth, then use grdinterpolate to combine these into a 3-D netcdf cube.

1 Like

And please also notice that your question has nothing to do with pyGMT but you posted it in that category.