Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plot 3D surface that is not the graph of a function

I have a 3D data set of a surface that is not a function graph. The data is just a bunch of points in 3D, and the only thing I could think of was to try scatter3 in Matlab. Surf will not work since the surface is not a function graph.

Using scatter3 gave a not so ideal result since there is no perspective/shading of any sort.

Any thoughts? It does not have to be Matlab, but that is my go-to source for plotting.

To get an idea of the type of surface I have, consider the four images: enter image description here

The first is a 3D contour plot, the second is a slice in a plane {z = 1.8} of the contour. My goal is to pick up all the red areas. I have a method to do this for each slice {z = k}. This is the 3rd plot, and I like what I see here a lot.

Iterating this over z give will give a surface, which is the 4th plot, which is a bit noisy (though I have ideas to reduce the noise...). If I plot just the black surface using scatter3 without the contour all I get is a black indistinguishable blob, but for every slice I get a smooth curve, and I have noticed that the curves vary pretty smoothly when I adjust z.

Some fine-tuning will give a much better 4th plot, but still, even if I get the 4th plot to have no noise at all, the result using scatter3 will be a black incomprehensible blob when plotted alone and not on top of the 3D contour. I would like to get a nice picture of the full surface that is not plotted on top of the 3D contour plot

In fact, just to compare and show how bad scatter3 is for surfaces, even if you had exact points on a sphere and used scatter3 the result would be a black blob, and wouldn't even look like a sphere

Can POV-Ray handle this? I've never used it...

like image 902
db1234 Avatar asked Aug 21 '12 08:08

db1234


People also ask

When would you use a 3D surface plot?

Surface Chart (3D Surface Plot) displays a set of three-dimensional data as a mesh surface. It is useful when you need to find the optimum combinations between two sets of data. The colors and patterns in Surface Charts indicate the areas that are in the same range of values by analogy with a topographic map.

What is a 3D surface graph?

A Surface chart (or 3D Surface plot) is a chart type used for finding the optimum combinations between two sets of data. As in a topographic map, the colors and patterns indicate the areas that are in the same range of values.

Which one of the following functions will plot a 3D graph?

In MATLAB, the plot3() function is used to draw the 3D plot graph.


1 Answers

If you have a triangulation of your points, you could consider using the trisurf function. I have used that before to generate closed surfaces that have no boundary (such as polyhedra and spheres). The downside is that you have to generate a triangulation of your points. This may not be ideal to your needs but it definitely an option.

EDIT: As @High Performance Mark suggests, you could try using delaunay to generate a triangulation in Matlab

like image 85
mathematician1975 Avatar answered Oct 16 '22 17:10

mathematician1975