EDIT 2
Question refined to: How can I use this information to impose Meshlines
which correspond to level sets of this graddata
?
Original
Suppose we have a data array of the form
{ {x1,y1,f(x1,y1)}, {x2,y2,f(x2,y2)}, ... , {xn,yn,f(xn,yn)} }
but we do not know the analytic form of the function f(x,y).
Here is a set of example data
Execution of that paste sets variable data. Then we make a ListPlot3D
as
ListPlot3D[data, MeshFunctions -> {Sqrt[#1^2 + #2^2] &, #3 &},PlotStyle ->
Automatic, MeshStyle -> {Blue, Green}, Mesh -> 21,
ImageSize -> 600]
To obtain
In this way, we were able to apply different Meshfunctions
to the ListPlot3D
.
For example, #3 &
makes mesh lines which are level sets of the 3rd coordinate, the height.
The other Meshfunction I used simply to illustrate that more sophisticated custom meshfunctions are possible.
However, this is the meshfunction I'd like to obtain: I want meshlines which represent level sets of the norm of the gradient vector of the surface.
Is there a way to achieve this? I only need for this to be approximate, clearly, as the data is discrete and not continuous. One way I could imagine to solve this might be to apply some complex array operations to the data set to obtain approximate slope magnitudes at every point, and apply some function to that to obtain the desired lines, but I don't know how to do that. Maybe there is a better way.
Please help!
============EDIT============
Suppose I build a new dataset
graddata={ {x1,y1,g(x1,y1)}, {x2,y2,g(x2,y2)}, ... , {xn,yn,g(xn,yn)} }
where g(x,y) is the norm of the gradient vector of the surface at (x,y). I believe I can achieve this.
Given this new graddata
, how can I implement this information into the ListPlot3D
in order to obtain the desired levelsets?
For example, I could ListContourPlot[graddata]
to obtain the level sets of the gradient-norm field, but how could I use implement to use this information to make such levelsets appear as Meshlines on the ListPlot3D
of data
?
============EDIT 2============
I have done as I described above an obtained the array of gradient-norm data: graddata
which is here:
This array has the form described in my first edit.
How can I use this information to impose Meshlines
which correspond to level sets of this graddata
?
MeshRegion
etc., so the sampled points are not arranged nicely on a rectilinear grid but rather somewhat "randomly" based on what MeshCellCoordinates it chooses for the Region. I'll probably have to abandon this in favor of a predictable grid, though. $\endgroup$