How to plot a 2D bathymetric contour map
Show older comments
I have been given a code to produce a 3D bathymetric contour map, but I have two problems;one is that the figure produced is just black and white where I would want it in colour and the other is that i want to produce a 2D plot rather than 3D.
Below is the code I have been given. Please can someone contact me and answer my queries, much appreciated.
clear all;
close all;
ln=3; ln2=6;
mk1=12; mk2=14; mk3=18; mk4=22;
load FASTNEt_cruise_bathymetry
[lon,lat]=meshgrid(lon.data,lat.data);
figure('color','white')
surf(lon,lat,z.data)
grid
onset(gca,'layer','top')
set(gca,'zlim',[-3500,0])
hold on
shading interp
colorbar
caxis([-2000,0])
set(gca,'layer','top')
set(gca,'fontsize',mk3)
[cc,ch]=contour3(lon,lat,z.data,[-200 -500 -1000 -1500 -2000],'k-');
clabel(cc,ch,[-200 -500 -1000 -1500 -2000],'fontsize',mk2,'fontweight','bold')
set(ch,'color','k')
xlabel('Longitude (^oE)','fontsize',mk3,'fontweight','bold')
ylabel('Latitude (^oN)','fontsize',mk3,'fontweight','bold')
zlabel('Depth (m)','fontsize',mk3,'fontweight','bold')
%To zoom in on detail set(gca,'xlim',[-10.5,-8.5]) set(gca,'ylim',[55.2,56.2])
Accepted Answer
More Answers (0)
Categories
Find more on Contour 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!