I want to represent the temperature variation at specific points of the equatorial atlantic ocean
Show older comments
I would like to make a card like the one in the picture
clear all; close all; clc
ncfile = ('example.nc'); %loads temperature file
ncdisp(ncfile) %info about ncfile
sst = ncread(ncfile, 'to');
lon = ncread(ncfile,'longitude');
lat = ncread(ncfile,'latitude');
% Read in the sea_ice_fraction data and store in a new variable called ice:
%gets sea surface temperature value
time = ncread(ncfile,'time') ; nt = length(time) ; %reads the time variable and obtains its size
[X,Y] = meshgrid(lon,lat) ; % transform longitudes and latitudes into a grid of lon long x lat dimension
%%generates map
figure('Color','white'); %creates figure
ax=worldmap([55 70],[50 52]); % loads world map with the limits for atlantic ocean
newx= reshape(X, 383, 523);
nsst = permute(data,[1 3 2]);
nsst = reshape(nsst,[],size(data,2),1);
nsst= reshape(data, []);
%setm(ax,'mapprojection','mercator','Origin', [180 0 180]) %changes projection and changes origin reference for coordinates
levels=[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ]; % creates levels for contours
geoshow(double(Y),double(X),nsst,'DisplayType','texturemap') %creates surface map of temperature
cb = contourcbar('peer',ax,'Location','northoutside'); %creates colorbar
caxis([15 35]) %defines limits for colorbar
colormap(jet) %sets color scheme
set(get(cb,'XLabel'),'String','SST (^oC)') %title for color bar
set(cb,'Position',[0.23 0.2417 0.5750 0.0335]) %adjust location and size of color bar
%levels=[28]; %sets level for contour defining specific
geoshow(double(Y),double(X),data,'DisplayType', 'contour','LevelList',levels,'LineColor','black') %plots temperature contour defining the western Pacific Warm Pool
hold on
land = shaperead('landareas.shp', 'UseGeoCoords', true); %define land areas
geoshow(land, 'FaceColor', [0 0 0]) % plots land areas in black
Accepted Answer
More 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!
