% Program to grid, view, contour and 3-D plot seamount topo data
% Get Seamount topography data, L. Braile (revised 11/14/01)
load seamount
% Plot locations of Bathymetry data
plot(x,y,'.','markersize',12)
axis on
xlabel('Longitude'), ylabel('Latitude'), pause
% Perform triangular sorting 
tri=delaunay(x,y);
hold on
% Plot Delaunay triangles
trimesh(tri,x,y,z)
hold off, hidden off, pause
[xi,yi] = meshgrid(210.8:0.01:211.8,-48.5:.01:-47.9);
% Grid data to 0.01 degree square grid using Delaunay
% interpolation and cubic smoothing
zi = griddata(x,y,z,xi,yi,'cubic');
% Contour the gridded data
[c,h] = contour(xi,yi,zi,'k-');
clabel(c,h)
pause
colormap(jet)
% Plot color contour of seamount
surf(xi,yi,zi)
shading interp
view(2)
axis([210.9 211.6 -48.4 -48 -4500 -500]);
pause
% Plot color contour and contour lines of seamount
surfc(xi,yi,zi)
shading interp
view([-37.5 45])
axis([210.9 211.6 -48.4 -48 -6000 -2000]);
pause
% Plot 3-D perspective view of seamount
surf(xi,yi,zi)
view([-37.5 45])
axis([210.9 211.6 -48.4 -48 -4500 -500]);
pause
% Plot 3-D perspective view with lighting
surfl(xi,yi,zi,'light')
shading interp
axis([210.9 211.6 -48.4 -48 -4500 -500]);
axis off
