How to plot one column in a martix
Mostrar comentarios más antiguos
I have a matrix of elevation at each latitude and longitude. I have plotted this as a surf plot using:
ncfile = 'chagos_new.nc' ; % nc file name
% To get information about the nc file
ncinfo(ncfile);
% to display nc file
ncdisp(ncfile);
% to read a vriable 'var' exisiting in nc file
elevation = ncread(ncfile,'elevation') ;
lat = ncread(ncfile,'lat') ;
lon = ncread(ncfile,'lon') ;
figure (5)
pcolor(lat,lon,elevation)
shading interp
surf(lat,lon,elevation)
colormap jet
colorbar
shading interp
grid on
title('Chagos Archipelago')
xlabel ('Latitude (^o)')
ylabel ('Longitude (^o)')
zlabel ('Elevation from sea surface level in meters')
colorbar
h = colorbar;
set(get(h,'label'),'string','Depth (m)');
I would like to plot a east west transect of this surf plot as a line plot, possibly with the x axis being distance in km and the y axis being elevation in meters. Does anyone know how to do this? And is there a way to select my transect between two particular lat lon co-ordinates as apposed to just an entire row of a matrix? The work-space is attached, let me know if anything else is needed. Thanks
1 comentario
Adam
el 26 de Feb. de 2018
doc plot
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Surface and Mesh Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!