카테고리 없음
Making Surface Plots From Scatter Data
오늘보다 나은 내일
2015. 9. 25. 14:41
[ Matlab FileExchange 에서 발췌 ]
How do you turn a collection of XYZ triplets into a surface plot?
>> load seamount
>> who -file seamount
The problem is that the data is made up of individual (x,y,z) measurements. It isn't laid out on a rectilinear grid, which is what the SURF command expects. A simple plot command isn't very useful.
>> plot3(x,y,z,'.-')
The solution is to use Delaunay triangulation. Let's look at some info about the "tri" variable.
>> tri = delaunay(x,y);
>> plot(x,y,'.')
Plot it with TRISURF
>> h = trisurf(tri, x, y, z);
>> axis vis3d
>> axis off
>> l = light('Position',[-50 -15 29])
>> set(gca,'CameraPosition',[208 -50 7687])
>> lighting phong
>> shading interp
>> colorbar EastOutside