How to plot a surface from 3D scatter data
Show older comments
Hi, I'm relatively new to MATLAB and have been struggling with a plotting problem. I have some 3D scatter data that results from a calculation done in spherical coordinates. The data are converted to cartesian coordinates for plotting. A sample of the data I am playing with are in the attached file. I would like to plot this data as a surface interpolated between the points.
If I plot the data as 3D scatter it renders well, but is hard to interpret:
%load data
load('SSTdata.mat');
scatter3(SST(:,1),SST(:,2),SST(:,3));
% remove non-unique points (from poles)
[A, ia, ic] = unique(SST,'rows');
% delaunay triangulation
tri = delaunay(A(:,1),A(:,2));
% plot
trisurf(tri,A(:,1),A(:,2),A(:,3));
but what is returned is not well representative of the data. I suppose I can see how it happened from the triangulation algorithm though. Is there a better way to do this?
1 Comment
Carine Alves
on 17 Jul 2018
Hello. I am facing the same problem.Could you solve the problem?
Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!